Hi,
I want to have my own custom sorting algorithm in JS on a ultraWebGrid column, and also allow users directly modifing cell values.
I followed the Url below to do the Client side sorting of a particular column in the UltraWebGrid.
http://help.infragistics.com/Help/NetAdvantage/ASPNET/2010.1/CLR3.5/html/WebGrid_Defining_a_Custom_Sorting_Algorithm_Client_Side.html
I cannot get it to work until I do the following:
UltraWebGrid1_InitializeLayout() {
e.Layout.LoadOnDemand = Infragistics.WebUI.UltraWebGrid.LoadOnDemand.NotSet; // or other non-Xml options...
}
because in the sorting Javascript (below), if the LoadOnDemand is Xml or 3, it performs sortXml(),
not my custom sorting function.
function igtbl_clctnSort(sortedCols){ if( !this.Band.IsGrouped && this.Grid.LoadOnDemand==3) return this.sortXml(); ...
However, once I set the LoadOnDemand property to anything other than Xml, custom sorting works,
but if I edit a data cell (with column DataType= System.String),
then I move the mouse focus to another cell, the cell value will change from the new value I entered,
back to the old value! I think it may cause a post back somehow. I can only fix this problem by setting the LoadOnDemand back to Xml.
But then I cannot do custom sorting!
Any ideas? I am using NetAdvantage_ASPNET_20092 for CLR3.5
Thanks.
try this..
dgGrid.DisplayLayout.LoadOnDemand =
LoadOnDemand.Automatic;
dgGrid.ResetColumns();
dgGrid.ResetRows();
-Ani
During the InitializeLayout(),
I tried to replace LoadOnDemand.Xml with the 3 statements you suggested. It came back with
a Null Reference Exception when it ran the next statement:
dgGrid.Columns.FromKey(aColumnName).Hidden = True
If I moved the ResetColumns() and ResetRows() after the above statement, the grid displayed "No data to display".