I am new to using your components but I have run into a problem that I can't find a way around.
I am trying to wrap the grid into a user control so that we can just set some basic properties and have it load the data (IE a sql statement). When I do this the grid works fine but if any kind of postback occurs the grid loses the column captions. The only unusual thing I am doing is that I have a property on my user control that allows columns to be specified in the ASPX file, these are then added to the rad grid:
<uc1:Grid ID="Grid1" runat="server" SQL="SELECT * FROM v_Requirement_AllFields" >
<Columns>
<telerik:GridHyperLinkColumn DataNavigateUrlFields="Requirement_RequirementId" DataNavigateUrlFormatString="ViewRequirement.aspx?RequirementId={0}" HeaderText="Reference" DataTextField="Requirement_RequirementReference"></telerik:GridHyperLinkColumn>
</Columns>
</uc1:Grid>
The code in my user control is very simple, basically as follows:
Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
For Each col As GridColumn In Columns
telerikGrid.Columns.Add(col)
Next
End If
End Sub
Protected Sub telerikGrid_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles telerikGrid.NeedDataSource
If Not String.IsNullOrEmpty(_sql) Then
telerikGrid.DataSource = GetDataStore(
Me.Page).GetDataTable(_sql)
End If
End Sub
I have tried this with both Ajax enabled or disabled.
Any ideas?