Geeks With Blogs


Google My Blog

Catch me at: The List!

My InstallScript Utility Belt My Amazon Wishlist
My Standard Disclaimer

Chris G. Williams Beware: I mix tech and personal interests here.

For those of you who spend more time messing with datagrids than I do (which is probably a fair number of you) I have a question...

I have a datagrid with several sortable bound columns. These work just fine. I also have a few template columns that you can't sort by, but still need to be sorted when you click on one of the sortable bound columns. (Does this make sense so far?)

The problem is, when I click on one of the sortable bound columns, the template columns stay put and don't sort with everything else.

So how do I address this? I've googled a bit on it, but keeping finding stuff that's not quite relevant to my particular dilemma.

Posted on Friday, April 28, 2006 7:48 AM General Interest | Back to top

Comments on this post: DataGrid question

# re: DataGrid question
Requesting Gravatar...
Why would you want your template columns to move with the sorted rows?

You must have some sort of dependency between the templated columns and the rows they "belong" to.

To make this work, you'll need to tie in the templated columns to some value in the underlying dataset for the grid, such as an ID field or datakey value. You need to add this field to the dataset and make your template columns render based on that value dynamically rather than hard-coding them.

Post your code and I might be able to help.
Left by Brian on Apr 28, 2006 5:02 PM

# re: DataGrid question
Requesting Gravatar...
Yeah, I do have a dependancy. Certain items in the templated columns only appear on a given row, and when I sort other columns asc or desc, the templated columns are staying put... no good.

Can't post the code, sorry, I'm under NDA... but I think I'm making progress.
Left by Chris Williams on May 01, 2006 8:39 AM

Your comment:
 (will show your gravatar)

Copyright © Chris G. Williams | Powered by: