Last post Jan 02, 2007 01:08 PM by Lolli
Oct 30, 2006 10:42 AM|iclements|LINK
Was just wondering if this feature was going to be included in the next release as it would be very usefull ? or does anyone know of a fix to get it working ?
Nov 13, 2006 09:47 PM|Russ Helfand|LINK
Sorry but this will not be in the next rev. I'll be sure that it's considered as we look towards the future.
Regarding building one yourself... I'd say that it shouldn't be too hard. You might be able to imitate one of the existing adapters in the kit. Or pop over to Scott Guthrie's blog where he has an overview of how to build any adapter, for example see
Nov 13, 2006 09:49 PM|Russ Helfand|LINK
Nov 15, 2006 10:49 PM|Lolli|LINK
Glad I caught you on this post. I am using the CSS friendly adapters and needed to add sorting headers to my gridviews.
The typical way of adding these header rows is to add them at rendering time. To accomplish that I modified the code to
1. when rendering the grid body, perform the typical detection of sorting columns and sections
2. when the grid is sorted, loop around the table rows instead of the grid rows to render the rows
3. when getting the row class, detecting the separators and giving them a special class that I created (background somewhat lighter than header)
Would be nice if that was in the next version [:D]
sortColumnIndex = i;
sortColumnHeaderText = gridView.Columns[i].HeaderText;
currentValue = ((
currentValue = gvr.Cells[sortColumnIndex].Text;
sortCell.ColumnSpan = gridView.Columns.Count;
lastValue = currentValue;
WriteRows(writer, gridView, gridTable.Rows,
WriteRows(writer, gridView, gridView.Rows,
private void WriteRows(HtmlTextWriter writer,
className += gridView.AlternatingRowStyle.CssClass;
className += gridView.EditRowStyle.CssClass;
className += gridView.SelectedRowStyle.CssClass;
className += gridView.HeaderStyle.CssClass;
Dec 07, 2006 12:17 PM|Russ Helfand|LINK
Hi Loli, thanks for the contribution. I have to admit that I am just now getting to review this. Please accept my apologies for the long delay.
I think I understand this thread but I've not examined your code yet line by line... so bear with me, please. Can we step back for a moment and crisply define what exactly you want to accomplish with the adapted GridView that isn't being done right now
at http://www.asp.net/cssadapters/gridview.aspx. I'm not suggesting that that page is ideal or perfect or meets your needs. I'm merely referring to it so we can have a reference point and say, "we
also need it to do xyz." If you can describe that, I'll work with you via this thread to figure out if your proposed solution is the only way or if there are alteratives (say, purely using the CSS with the existing adapter) that we might consider, too.
In any case, I would expect that whatever we do here will be picked up when I do my traditional "mining" of this forum when developing the to-do list for the rev of the adapters. Sound fair?
Jan 02, 2007 01:08 PM|Lolli|LINK
See, you're not the only one who takes forever to answer. Sorry for the delay.
OK. The idea is that, when sorted, the grid displays a separator row containing the value of the current sorted item.
Like in this sample: