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
I'm not sure what else to tell you. I just tested this out and it works fine for me.
Are you saying that e.Row is returning the wrong row?
I have to go on record and say that there is a bug on retreiving the current row information in the AfterRowExpanded method. If you press on the "+" on a parent row that is not selected (row selector active), you will not get the row information on the row you pressed the "+".
The only way that I am able to get the row information I am looking for is by pressing on the row (row selector) then pressing on the "+" to expand the child rows. I feel this is a bug because the when expanding the child rows on a parent row that function works great, but I can't get the parent row information unless I select the parent row (row selector).
This is driving me nuts. I would like to think that I am doing something wrong with my code, but I have tried everyway I know how to discount it.
I will provide whatever necessary to show you what I am doing to get the results that I am. I'm very confident that you will get the same results that I am putting in place code to view the parent row information.
It's not working because you are using the ActiveRow property and not e.Row.
The line of code you have here doesn't make any sense. You are using the RowSelectorNumber as an index into the Rows collection of the grid to get a reference to a row that you already have.
If you want to get a reference to the row, you can just use e.Row. You don't need to use the row number.
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...
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!