I have dynamically generated user control that contains RadGrid.
This control I need to show up due to user request (some button click). When user clicks on button control is rendered properly but if I try to change page then grid is not changing its state.
If i try to change the page size then it throws exception like that:
Thank you
| Protected Overrides Sub CreateChildControls() |
| MyBase.CreateChildControls() |
| GenerateTable() |
| End Sub |
| Private Sub GenerateTable() |
| If BtnExpandOpen Then |
| Dim ctrl = GetProperControl(RowIndex) |
| If ctrl IsNot Nothing Then |
| ctrl.WriteToDisplay(Me) |
| PanelCategory.Controls.Add(ctrl) |
| End If |
| End If |
| End Sub |
| Private Sub btnExpand_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles btnExpand.Click |
| BtnExpandOpen = Not BtnExpandOpen |
| SetExpandButtonState() |
| GenerateTable() |
| End Sub |
This control I need to show up due to user request (some button click). When user clicks on button control is rendered properly but if I try to change page then grid is not changing its state.
If i try to change the page size then it throws exception like that:
What have I do if I need to create RagGrid not in PageInit or PageLoad events but rendered grid must have some postbacks (i.e. paging)?
[NullReferenceException: Object reference not set to an instance of an object.] Telerik.Web.UI.RadGrid.RaisePostBackEvent(String eventArgument) +8609 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175
Thank you