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

Grid Sorting

1 Answer 25 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dave Hollen
Top achievements
Rank 1
Dave Hollen asked on 23 Feb 2010, 05:22 PM
I am using a RadGrid that contains a GridTemplateColumn.  This GridTemplateColumn contains a FilterTemplate as well as an ItemTemplate.  The FilterTemplate is a RadComboBox.  The ItemTemplate is a Label.  The table is displaying the string representation of an ID.

I want to run a sort based on the string displayed in the Label.  However, since this data is not databound, it will not let me.  It will allow me to run a sort based off of the underlying "Value" of this data.  (The Value = RoleID and the Label contains the corresponding RoleName.)

How can I do this?  I want to sort the GridTemplateColumn based on what is displayed in the ItemTemplate of this column (the Label).

Thanks!
Dave

1 Answer, 1 is accepted

Sort by
0
robertw102
Top achievements
Rank 1
answered on 23 Feb 2010, 07:30 PM
If the RoleName is part of the table your binding the grid to, you could just set SortExpression="RoleName" for the template column.

I don't know if that's possible with your situation since you say it's not databound, but I don't see how you would enable sorting on something that isn't part of the grid's datasource.
Tags
Grid
Asked by
Dave Hollen
Top achievements
Rank 1
Answers by
robertw102
Top achievements
Rank 1
Share this question
or