Grid Sorting

2 posts, 0 answers
  1. Dave Hollen
    Dave Hollen avatar
    46 posts
    Member since:
    Jan 2010

    Posted 23 Feb 2010 Link to this post

    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).

  2. robertw102
    robertw102 avatar
    265 posts
    Member since:
    Jul 2007

    Posted 23 Feb 2010 Link to this post

    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.
Back to Top