I have the grid like this:
<telerik:RadGrid ID="ReportsListGrid" ShowStatusBar="true" runat="server" AllowPaging="True"
AllowSorting="true" AllowMultiRowSelection="True" PageSize="20" OnNeedDataSource="ReportsListGrid_NeedDataSource">
<MasterTableView TableLayout="Fixed" DataKeyNames="ReportId" AutoGenerateColumns="True">
<Columns>
<telerik:GridBoundColumn DataField="ReportId" HeaderText="ReportId" AllowFiltering="false"
SortExpression="ReportId" />
<telerik:GridBoundColumn DataField="Name" HeaderText="Name" SortExpression="Name" />
<telerik:GridBoundColumn DataField="Description" HeaderText="Description" SortExpression="Description" />
<telerik:GridBoundColumn DataField="ReportLocation" HeaderText="ReportLocation" SortExpression="ReportLocation" />
<telerik:GridBoundColumn DataField="Active" HeaderText="Active" SortExpression="Active" />
</Columns>
</MasterTableView>
</telerik:RadGrid>
And Following is how i am binding it:
Dim reports = ReportFactory.CreateReportController().GetReports()
'reports is IList collection
ReportsListGrid.DataSource = reports
ReportsListGrid.DataBind()
On the pageload grid loads correctly, but when i click on any column header for sorting it says:
"System.IndexOutOfRangeException: Cannot find column ReportLocation."
Please help!!!!!!!!!!!
Thanks J
<telerik:RadGrid ID="ReportsListGrid" ShowStatusBar="true" runat="server" AllowPaging="True"
AllowSorting="true" AllowMultiRowSelection="True" PageSize="20" OnNeedDataSource="ReportsListGrid_NeedDataSource">
<MasterTableView TableLayout="Fixed" DataKeyNames="ReportId" AutoGenerateColumns="True">
<Columns>
<telerik:GridBoundColumn DataField="ReportId" HeaderText="ReportId" AllowFiltering="false"
SortExpression="ReportId" />
<telerik:GridBoundColumn DataField="Name" HeaderText="Name" SortExpression="Name" />
<telerik:GridBoundColumn DataField="Description" HeaderText="Description" SortExpression="Description" />
<telerik:GridBoundColumn DataField="ReportLocation" HeaderText="ReportLocation" SortExpression="ReportLocation" />
<telerik:GridBoundColumn DataField="Active" HeaderText="Active" SortExpression="Active" />
</Columns>
</MasterTableView>
</telerik:RadGrid>
And Following is how i am binding it:
Dim reports = ReportFactory.CreateReportController().GetReports()
'reports is IList collection
ReportsListGrid.DataSource = reports
ReportsListGrid.DataBind()
On the pageload grid loads correctly, but when i click on any column header for sorting it says:
"System.IndexOutOfRangeException: Cannot find column ReportLocation."
Please help!!!!!!!!!!!
Thanks J