Hi,
I'm using a ultragrid on a form. The data is :2 levels, header-child, so i made it expandable. This is used on a touch screen, on lift truck ... no mouse.So the left hand + sign (to expand/Colapse) is hard to click, so i added code to the ultragid.doubleclick event. This expands if it is not, and if it is it colapse the active row ...
When I have multiple first levels, if i expand one row, and the child node as enough rows to make the scrollbar appear, when I doubleClick enough times at the bottom of the scrollbar, all the child nodes colapses, and even if i have 5 parent node, only one will display.
If i click on the remaining row, all comes back to normal?
Normal?
I'm using netAdvantage 10.3. ...
Thanks.
Marc.
Hi Marc,
I'm having trouble understand what you are describing. I understand that you have a 2-level grid. and you are using the grid's double-click event to expand rows. Are you expanding all of the rows on a double-click? Or just the active row?
Either way, the double click event of the grid will fire when you double-click anywhere in the grid, including the scrollbar. So that can be a little confusing because for most controls, this does not happen. But this is a result of the fact that we have our own style-able scrollbars instead of using the built-in windows scrollbar. If you don't want to respond to the double-click event when the user double-clicks the scrollbar, you could use the grid's UIElements to determine where the double-click occurred. But it doesn't sound like that's your question.
But I'm really not sure what you are asking. Maybe you could post a small sample project, or some screen shots to help explain what you need.
Hello ,
It seems that the code of the doubleClik event of ultraGrid cause this issue, could you please share this code. Also have you tried to reproduce this if you unsubscribe (comment and ignore the code ) for DoubleClick event of UltraGrid.
I am waiting for your feedback.
Hello.
I 'want' to only expand the active row. And that is what happens normally.
I'll respond with a screen shot soon.
If i comment out the code , the expand/colapse doens't happen ... it's logic :)
Here is the code: (only when the parent 'node' is active)
Private Sub Grid_DoubleClick(sender As Object, e As System.EventArgs) Handles UltraGrid1.DoubleClick
Dim UGRid As UltraGrid = CType(sender, UltraGrid) If UGRid.ActiveRow.Cells(1).Column.Key.ToString = "BOL" Then If UGRid.ActiveRow.Expanded = True Then UGRid.ActiveRow.Expanded = False Else UGRid.ActiveRow.Expanded = True End If End If
TxtBarcodeNumber.Focus() End Sub
Well, this code will respond to a double-click anywhere within the grid. Is that what you want?
If so, then it looks fine to me. I can't see any reason why this could affect anything other than the ActiveRow.
Maybe this code is triggering some other event handler in you code and that code is doing something which is causing it. What other events of the grid are you handling?
Also... if other rows in the grid are getting expanded or collapsed, then you could put a breakpoint into the BeforeRowExpanded event and look at the call stack to see where it's coming from. Of course, you have to ignore the expand/collapse operation you are causing intentionally.