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
I implemented your code and am getting the below exception error:
{"Unable to cast object of type 'Infragistics.Win.UltraWinGrid.UltraGridRow' to type 'Infragistics.Win.UltraWinGrid.UltraGridGroupByRow'."}
on the line:
For Each grow As UltraGridGroupByRow In Me.grdAllProposals.Rows
any suggestions?
Thanks!
Please disregard my last post . It only works if e.Row is a UltraGridGroupByRow(created by setting sortedcolumns). I think you are catching if a UltraGridRow is being expanded.
I've never used expanded UltraGridRow's myself. If your problem is that you expand a row and the e.Row.index returns the next row's(child) index you could try using : e.Row.ParentRow.Index.
Hope that this can help more than last post did...