Hello,
I have a RadGrid that is displayed inside another RadGrid through NestedViewTemplate. This RadGrid contains auto generated columns, and one GridTemplateColumn that I have added to calculate the sum of two auto generated columns. I would like to change the location of this column, currently it shows as the first column in the RadGrid.
This is what the RadGrid looks like:
<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="false" Width="100%"
AllowFilteringByColumn="true" AllowSorting="true" EnableHeaderContextMenu="true" EnableLinqExpressions="false"
EnableHeaderContextFilterMenu="true" Skin="Windows7" ShowFooter="true" OnItemDataBound="RadGrid1_ItemDataBound"
OnNeedDataSource="RadGrid1_NeedDataSource" OnPreRender="RadGrid1_PreRender" OnColumnCreated="RadGrid1_ColumnCreated" >
<MasterTableView EnableNoRecordsTemplate="true" ShowHeadersWhenNoRecords="true" AutoGenerateColumns="true" IsFilterItemExpanded="false" AllowFilteringByColumn="true" TableLayout="Auto">
<NoRecordsTemplate>
<div style="width:100%;text-align:center;">
No are no records to display!
</div>
</NoRecordsTemplate>
<Columns>
<telerik:GridTemplateColumn UniqueName="Total" HeaderText="Total" SortExpression="Total">
</telerik:GridTemplateColumn>
</Columns>
<FooterStyle Font-Bold="true" Font-Size="Large" />
</MasterTableView>
</telerik:RadGrid>
And the PreRender contains:
(sender as RadGrid).MasterTableView.GetColumn("Total").OrderIndex = 2;
But it still is being displayed as first.