My unbound column has a label that is populated server side from some stringbuilder data where sorting would not make sense.
I can set AllowSorting="false" on the bound columns but not the unbound column.
So the unbound column, which I do not want sorting enabled, is rendered with a sortable header link.
Why doesn't the unbound column have the AllowSorting property? I think it would make a lot of sense to have that for an unbound column.
Right now, server side, I am having to delve into all the child controls of the grid till I get the sorting header LinkButton for that column and then I set OnClientClick="return false;"
Is there an easy way to turn off sorting for just the unbound GridTemplateColumn while still being able to sort the bound columns?
here's my grid:
<RadControl:RadGrid ID="RadGridUsers" runat="server" Skin="Default" Width="511px" Height="564px" BorderWidth="0" GridLines="None" AutoGenerateColumns="False" ShowGroupPanel="False" AllowPaging="False" AllowSorting="True" EnableEmbeddedSkins="false">
<ClientSettings ReorderColumnsOnClient="False" AllowDragToGroup="False" AllowColumnsReorder="False" Selecting-AllowRowSelect="true">
<Scrolling AllowScroll="true" UseStaticHeaders="true" />
<Selecting AllowRowSelect="True"></Selecting>
<Resizing AllowRowResize="False" EnableRealTimeResize="False" ResizeGridOnColumnResize="False" AllowColumnResize="False"></Resizing>
<ClientEvents OnRowSelected="RadGrid_RowSelected" /></ClientSettings>
<MasterTableView DataKeyNames="UserProfileId,FidelityId" ClientDataKeyNames="UserProfileId,FidelityId" GroupLoadMode="Client" AllowMultiColumnSorting="False" AllowNaturalSort="false">
<SortExpressions>
<RadControl:GridSortExpression FieldName="LearningCenterId" SortOrder="Ascending" />
</SortExpressions>
<NoRecordsTemplate>
<div style="text-align: center; height: 300px">
<asp:Label ForeColor="RoyalBlue" Font-Size="14" runat="server" ID="Label1">There are no items to display</asp:Label>
<br />
</div>
</NoRecordsTemplate>
<Columns>
<RadControl:GridBoundColumn UniqueName="Name" SortExpression="Name" HeaderText="Employee Name" DataField="Name" ShowSortIcon="true">
<HeaderStyle Width="25%" Wrap="false" HorizontalAlign="left" VerticalAlign="Middle"></HeaderStyle>
<ItemStyle HorizontalAlign="Left" VerticalAlign="Top"></ItemStyle>
</RadControl:GridBoundColumn>
<RadControl:GridTemplateColumn UniqueName="Details" SortExpression="Details" HeaderText="Details" ShowSortIcon="false">
<HeaderStyle Width="50%" Wrap="false" HorizontalAlign="left" VerticalAlign="Middle"></HeaderStyle>
<ItemStyle HorizontalAlign="Left" VerticalAlign="Top"></ItemStyle>
<ItemTemplate>
<asp:Label ID="lblGridDetails" runat="server" Text=" "></asp:Label>
</ItemTemplate>
</RadControl:GridTemplateColumn>
<RadControl:GridBoundColumn UniqueName="Title" SortExpression="Title" HeaderText="Title" DataField="Title" ShowSortIcon="true">
<HeaderStyle Width="25%" Wrap="false" HorizontalAlign="Center" VerticalAlign="Middle"></HeaderStyle>
<ItemStyle HorizontalAlign="Left" VerticalAlign="Top"></ItemStyle>
</RadControl:GridBoundColumn>
</Columns>
</MasterTableView>
</RadControl:RadGrid>
Thanks,
RjD