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
1000
grid.SelectedRows.Count property has a value of 0
posted

Hi guys,

I really start to lose my nerves on this one.

I rebuild a page over and over to find out the problem and I can't find the problem that is causing it.

In general, I have about 3 Ultrawebgrids in a page, i select a row and than I click on a button. Till here all goes fine. I add another Ultrawebgrid, with the same configuration, but with other names and it breaks up the whole page, when I remove that last grid, the problem remains. This is really a showstopper, I handled all really carefully by adding one piece at the time with a validation to see if the select still works.

When I place breakpoints, the InitializeDataSource gets first called before the actual click method gets handled. Not only the selectedrow gets back to 0, the grid will be empty after the partial callback.

What is going on?

Edit:

I placed breakpoint in page_load and grid_InitializeDataSource. It seems that the InitializeDataSource gets executed before the Page_Load.

  • 1000
    Verified Answer
    posted

    I start to figure out the horror that can happen.

    I have different pages that has the problem, and that is coming because the event bubble of the Ultrawebgrid is unpredictable. Sometimes it passes first page_load and than the OnInitializeDataSource event on a partial post back, but small changes can disturb this and demands that you reload the sessions in Page_PreInit. And now I even saw that OnInitializeDataSource in certain cases even passes by this PreInit event.

    I solved my problem, but unhappy aswell because of this unpredictable behaviors.