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
415
CellControl is null, Race condition?
posted

I have a webGrid on page and I am filling it out as follows:

A webservice is called in the contructor.

When the webservice returns i create the columns for the grid, then bind it to an object. I then attempt to go row by row and add things to different cells. I try to access a cells content but it is null.

Is there an event that i can use to wait once all cells contents are created?

row.Cells[i].Control is null.

This used to work, but before i had a second webservice called inbetween the creation of the grid and the filling of the cells. 

Parents
  • 12631
    posted

    Its generally not a good practice to call a web service from the page constructor.  Can you call it in OnNavigatedTo (if this is a Page) or Loaded (if this is a User Control)?

    This makes sure that all of the controls are loaded and ready for the kind of maniplation your trying to do.

    Devin

Reply Children
No Data