Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
285
Select first Row in a Grid
posted

I would like to select the "first" row in a grid when it is initially populated. I have been doing this successfully with the following code:

Dim firstRow As UltraGridRow = grid.DisplayLayout.RowScrollRegions(0).FirstRow

If (firstRow IsNot Nothing) Then

firstRow.Activate()

firstRow.Selected = True

End If

I have now introduced a new grid, in which grouping has been switched on at design time. When grouping is enabled, the first (unexpanded) group is selected (or maybe active), which is OK. 

What I don't understand is that if the user switches off grouping, FirstRow is an UltraGridGroupByRow and the above code does not select the first real row (although it appears that it is the active row).

I have tried to compare the properties of the 2 types of grid to determine which property is creating this behaviour, but I haven't been able to. Can someone tell me which it is?  I'd then like to modify the code above so that it will definitely select the first row when grouping is switched off.

Thanks.

 

Parents Reply Children
No Data