Hi !
I have a grid with columns user_location, user_name, action, role, all groupable. When the user clicks a row I use the rows user_location and user_name to fill up a form. But, when I group the grid by the user_location, and the user click a row in the grid - i get an exception that the "user_location" cell does not exist in the row.
Is there a way to find out the value for this cell ?
Thanks,
Marius.
I assume that your problem has something to do with the fact that the UltraGridGroupByRow's Cells property returns null. Since the UltraGridGroupByRow represents a grouping of rows each of which has the same cell value, that value is exposed via the UltraGridGroupByRow.Value property.
Thanks for the answer!
Not sure I got it : so, if i group by a column, the grouped value will be held in the UltraGridGroupByRow.Value . What if I group by more than one column ?
Marius,
Even when you group by more than one column you will retrieve the value you want from the Value property of the UltraGridGroupByRow. When you group by more than one column you will have parent rows and child rows but they are all UltraGridGroupByRows. So if you click on on of the child rows you will still retrieve the value in the same way that you do when you click on a parent row.
I hope this helps.
Michael S.
Thanks for your explanation Michael, but I'm afraid I still don't know how could I use that. My problem is like this - when the user click or moves in the grid with the arrow keys (ClickCell and BeforeSelectChange events) I use the data from the active row to fill up a form. The problem is that when I do a group by, the BeforeSelectChange triggers and i get an exception because the ActiveRow.Cells = null.
From what I'm seing, after grouping the ActiveRow is UltraGridGroupByRow.
Could you give me a practical advice how to proceed to fix my problem ?
Thank you!
It sounds to me as though in the BeforeSelectChange event you need to test whether or not your active row is an UltraGridGroupByRow. If it is not then you can retrieve the value of the cell from the ActiveRow just as you are doing now, but if it is an UltraGridGroupByRow then you must retrieve the value of rhe UltraGridGroupByRow. You may also need to look at either the HasChild property or the HasParent property to determine in which group the row belongs.
Michael
Did my last suggestion help you to accomplish what you wanted? Let me know if you have further qustions.