Telerik RadGrid doesn't display on first Page_Load but does on postback

Posted by Mark on Stack Overflow See other posts from Stack Overflow or by Mark
Published on 2010-03-17T15:48:51Z Indexed on 2010/03/17 15:51 UTC
Read the original article Hit count: 1007

Filed under:
|
|
|

I have a page with a drop-down. Based on the selection in the drop-down, data gets loaded and populates a RadGrid. I am using a custom user control for the EditTemplate, so I can't use radGrid.DataBind(). Instead, I have to use radGrid.MasterTableView.Rebind() in association with a NeedDataSource event handler.

My problem is that when I load the page initially, I populate the drop-down and automatically select a value (first item in the list) which triggers the databinding on the RadGrid. I can step through the code in debug mode and see that the grid is being populated with data, but when the page displays, it doesn't get rendered. When I then manually choose an item from the drop-down, which triggers the same grid databinding code, it displays properly the second time.

How do I get it to display the grid the first time the page loads?

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about telerik