Hey guys, what I am trying to do is add a method to my gridview's sorting event to add a class to the column being sorted so the user can know if the data is being sorted ascending or descending and on what column. I am currently trying to do it through a switch statement on the sort expression to determine what column it's coming from but I am unaware of how to set the css class. Any ideas?
A:
I got it working, turns out I was over thinking it but the task is easily accomplished via:
gridview.HeaderRow.Cells[0].CssClass = "sorted" + sortString;
Jimmy
2010-01-20 15:34:59
Be aware that this only works for columns that were not autogenerated (I mean by using AutogenerateColumns = True (true is the default value by the way), because the autogenerated columns will not be added to the column collection.
citronas
2010-01-20 18:49:31
yeah I am aware, and it isn't an autogenerated column
Jimmy
2010-01-21 20:30:00