vs2005 - winforms - ultragrid
I have a situation where I am trying to capture the row number on the row that is being expanded. When I click on the "+" to expand the child rows, the currentrow returns what row was physically selected, not the row that I am trying to expand. I am trying to capture the current row on the AfterRowExpanded event.
Any help would be fantastic.
Thanks in advance.
Wayne
Hi Im not sure this is what you are after but it's the best I can do.
If you return the Index on e.Row after AfterRowExpanded event is fired you get the index of the GroupByRow that has got a row collection in it.
If you want the index of the first row in the GroupByRow Rows collection I don't think there is a direct way to do that.
But you can try something like this:
Dim ind As Integer
ind = e.Row.Index
If grow.Index = ind Then
MsgBox(grow.Rows(0).index)
End If
Next
Well there lies the confusion. On the expanded row if I try to capture the row number, it only gives me the row that was last selected, not the current one.
For example:
I select a row in the grid. I can capture that row number (Row 3 for example). Now when I select the "+" on another row (not row 3) to expand the child rows, and in the event of AfterRowExpanded I try to capture the row number (of that parent row), I get returned Row 3. It is like I have to select a row for it to return the row number. By why can't I capture the correct row number on a row that I only press on the "+" ?
....
Me.grdAllProposals.Rows(Me.grdAllProposals.ActiveRow.RowSelectorNumber)
.....
Hi Wayne,
One of us is very confused.
If you trap the AfterRowExpanded event and examine e.Row, this should return the row that is being expanded. This may or may not be the active row.
The event does pass e.row etc but I have not found how to capture the row that you are expanding. You seem to have to select the row then the "+" to beable to capture the current row. My problem is that the users are pressing the "+" without selecting the row. Pressing the "+" expands correctly, but in code I am trying to capture the row number that is being expanded (parent)
I have tried about every code avenue and knowledge base on this subject, but still am coming up empty handed. You are the first to respond to my problem
Hope that makes sense.
Wayne.
Doesn't the event pass you the row? Like e.Row?