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

Sorting on a template column

1 Answer 78 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Nick
Top achievements
Rank 2
Nick asked on 19 Aug 2008, 07:04 PM
I have a template column that represents a checkbox.  The checkbox is filled in on a databind,  from a list.  The other columns come from a sqldatasource.

I need to sort the column based upon whether it's checked or not.   I can't find an easy way to dynamically adjust the sort expression (it won't bind).

???

Thanks,
Nick H

1 Answer, 1 is accepted

Sort by
0
Nikita Gourme
Top achievements
Rank 1
answered on 22 Aug 2008, 01:18 PM
Since your template columns are not bound directly from the sqldatasource control, you can not perform declarative sorting  for that column as in this demo (see the last column).

Instead the quickest turnaround that comes to my mind is to  have a hidden bound column in the grid with the same true/false values and sort on that column. Other solution would be to perform your own custom sorting on some other criteria - check out this example for a start.

Nikita
Tags
Grid
Asked by
Nick
Top achievements
Rank 2
Answers by
Nikita Gourme
Top achievements
Rank 1
Share this question
or