Hi All,
I've a very simple page with a RadGrid, on clicking the header to sort, I get the error :-
Unable to cast object of type 'Telerik.Web.UI.RadGrid' to type 'Telerik.Web.UI.GridTableView'.
This only happened after upgrading the DLLs to 2016.2.607.40 from 2014.1.403.40
Going back to the old DLL fixes the issue.
Serverside I populate a DataTable and then use Datasource/Databind.
<telerik:RadGrid ID="dtgParameter" runat="server" CssClass="dataGridStyle" Width="99%" GridLines="Both" Height="100px" AllowSorting="True" AllowMultiRowSelection="False" AllowPaging="False" AutoGenerateColumns="False" ShowFooter="false" ShowHeader="true"> <HeaderStyle CssClass="dataGridHeader" /> <ItemStyle CssClass="dataGridItemStyleNormal" /> <AlternatingItemStyle CssClass="dataGridItemStyleAlt" /> <SortingSettings EnableSkinSortStyles="false" /> <ClientSettings EnablePostBackOnRowClick="false"> <Selecting AllowRowSelect="true" UseClientSelectColumnOnly="true" /> <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="True" /> </ClientSettings> <MasterTableView Name="Parameter" DataKeyNames="ParameterId" ShowHeader="true" AutoGenerateColumns="False" HierarchyLoadMode="ServerOnDemand" width="99%"> <Columns> <telerik:GridBoundColumn HeaderStyle-ForeColor="White" DataField="ParameterId" HeaderStyle-Font-Bold="True" SortExpression="ParameterId" HeaderStyle-Width="0%" HeaderText="" visible="false"/> <telerik:GridBoundColumn HeaderStyle-ForeColor="White" DataField="Name" HeaderStyle-Font-Bold="True" SortExpression="Name" HeaderStyle-Width="20%" HeaderText="Name" /> <telerik:GridBoundColumn HeaderStyle-ForeColor="White" DataField="Comments" HeaderStyle-Font-Bold="True" SortExpression="Comments" HeaderStyle-Width="80%" HeaderText="Comments" /> </Columns> </MasterTableView> </telerik:RadGrid>