This is a migrated thread and some comments may be shown as answers.

Selective sort. (Only certain columns)

4 Answers 119 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mike Causi
Top achievements
Rank 1
Mike Causi asked on 03 Aug 2010, 08:41 PM
Is there a way to exclude certain columns from being clickable in a grid, so that they cannot be sorted.
Just because I have 10 columns listed, doesn't mean I want all of them to be sortable.

Please let me know.

Thanks.

4 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 04 Aug 2010, 06:53 AM
Hello Mike,

You can achieve by simply setting the AllowSorting property of column to False to exclude the particular column from sorting.

aspx:
<telerik:GridBoundColumn DataField="CustomerID" AllowSorting="false" HeaderText="CustomerID"
    UniqueName="CustomerID">
</telerik:GridBoundColumn>


-Shinu.
0
Mike Causi
Top achievements
Rank 1
answered on 04 Aug 2010, 01:20 PM
Perfect.  I don't know how I overlooked that one.
0
Erik
Top achievements
Rank 1
answered on 26 Aug 2010, 10:17 AM
Hi.

I cannot use this AllowSorting="false".
because the column that should not be able to sort is not a GridBoundColumn
<telerik:GridTemplateColumn UniqueName="itemVolgorde" DataField="itemVolgorde" HeaderText="Item Nr." FooterText="Item Nr." AllowSorting="false"  >
 <ItemTemplate>
  <asp:Label ID="lblItemNur" runat="server" Text='<%# Eval("itemVolgorde") %>' />
  <asp:TextBox ID="txtBoxName" runat="server" Text='<%# Bind("itemVolgorde") %>' Width="95%" Style="display: none" />
 </ItemTemplate>
</telerik:GridTemplateColumn > 

This column should not be sortable but with this option i get the next Error:

An unexpected error occurred loading Web Part. Type 'Telerik.Web.UI.GridTemplateColumn' does not have a public property named 'AllowSorting'.

How do I get AllowSorting false on this column type?

Kind regards
0
Erik
Top achievements
Rank 1
answered on 26 Aug 2010, 10:33 AM
I found the value -> Reorderable="False"

that one seems to be working,

thanks
Tags
Grid
Asked by
Mike Causi
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Mike Causi
Top achievements
Rank 1
Erik
Top achievements
Rank 1
Share this question
or