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
375
Populating via CellDataRequested, where can I select the first row?
posted

I have a grid that is bound to an ultradatasource. I use the CellDataRequested event on the ultradatasource to populate it, along with populating the cell values for the row I also put a piece of data in the tag for the ultra data row.

This all works fine, except that once the grid has populated I want to select the first row, e.g. grid.Rows[0].Selected = true.

I thought I could do this from the CellDataRequested event for the first row (if e.Row.Index == 0 then grid.Rows[0].Selected = true.). This will obviously cause a AfterSelectChange to be fired on the grid, which is fine - except that if you look at grid.Selected.Rows[0] at this point although a row exists its cell values are empty, you can access the UltraDataRow for this gridrow, but it also has no values and more importantly (for what Im doing) the tag of the UltraDataRow is null.

It should be noted that this appears to be a time based problem - if I have a few breakpoints and spend a second or two on them and then continue the row will have values when it gets to the AfterSelectChange. Its like although I have populated the datasource it hasn't finished binding.

Basically what I need is some way of knowing that the first row has been populated so I can select it.

Any ideas?

Parents Reply Children
No Data