I have a grid with columns that are generated dynamically based on a specific dataset. For example, if there are 6 records in my dataset then I will add 6 columns to a grid. If there are 7 I would add 7 columns to the grid. The columns I am generating are template columns that are being created on the server side. In these columns there is either a red or green ball image displayed based on a certain criteria (a calculation performed in the constructor of my template). Essentially this is leaving the columns un-databound to a specific field in the result set.
I am trying to sort these dynamically created columns so I could show all the green ball images on top or the other way around. I figured the easiest way to do this would be to add a hidden column with each image template column I create. So instead of creating 6 columns for my dataset I would create 12 with 6 of them being hidden. In these hidden columns I could simple put the path to the ball images; either "redBall.gif" or "greenBall.gif". The question is how do I then sort using one of the hidden columns?
Simply put: I want to sort by the text in a specific column (redBall.gif or greenBall.gif). The problem I am running into is I do not have a DataField or SortExpression to bind the grid to. I've looked at most, if not all, of the articles on Telerik and cannot find much help.
I appreciate any ideas.
Thanks.
I am trying to sort these dynamically created columns so I could show all the green ball images on top or the other way around. I figured the easiest way to do this would be to add a hidden column with each image template column I create. So instead of creating 6 columns for my dataset I would create 12 with 6 of them being hidden. In these hidden columns I could simple put the path to the ball images; either "redBall.gif" or "greenBall.gif". The question is how do I then sort using one of the hidden columns?
Simply put: I want to sort by the text in a specific column (redBall.gif or greenBall.gif). The problem I am running into is I do not have a DataField or SortExpression to bind the grid to. I've looked at most, if not all, of the articles on Telerik and cannot find much help.
I appreciate any ideas.
Thanks.