Hi,
I found a solution to sorting a WinGrid using SortComparer, however I cannot find a solution for a WebGrid. I am trying to sort a grid so it will sort like it does in excel. Currently it is sorting values as 1%, 11% 2% etc rather than 1%, 2%, 11%. The reason why I cannot simply make it a integer field is because there are columns with text in them such as - or N/A.
Does anyone have a solution?
Thanks in advance.
Dan
Hi Alex,
Thank you for getting back to me. I looked at the post you sent me and rather than creating my own sorting algorithm I decided to return another column when databinding and sorting by that field.
//Save();
UltraWebGrid.Bands[0].SortedColumns.Add(UltraWebGrid.DisplayLayout.Bands[0].Columns[Convert.ToInt32(Session[
This seems to work alright. The problem I am having now is if I uncomment the Save() method call in UltraWebGrid1_SortColumn then I get a null reference error. The stack trace is below:
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.] Infragistics.WebUI.UltraWebGrid.UltraWebGrid.UpdateDBRow(UltraGridRow row, UltraGridRow oldRow) +155 Infragistics.WebUI.UltraWebGrid.UltraWebGrid.ProcessChanges(StateChanges stateChanges, Boolean fireEvents) +1557 Infragistics.WebUI.UltraWebGrid.UltraWebGrid.RaisePostDataChangedEvent() +161 System.Web.UI.Page.RaiseChangedEvents() +165 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1485
Please at your earliest convience can you help me troubleshoot this? Is this a bug in the UltraWebGrid?
Thanks in advance,
Alex,
I got the same problem. Could you specify how to postback and where to postback in this case?
Thanks
AllowSorting should be set to Yes (on server) as opposed to OnClient.