I have a ultra web grid (version 2010), the problem I am facing is with the performance of sorting. its taking too much time for doing the sorting. How can i improve the speed of sorting the data in the Grid.
I thought of doing a custom server side sorting, but the problem is when ever i click on the header, its doing the in-built client side sorting and then comes to the SortColumn Event. I want to disable the client sorting. The header is disabled if I put "header click action = NotSet" or if I put "header click action = SortSingle" (if i put this option then only header click is getting enabled) its doing the default client sort first. I am putting "AllowSorting = "yes" and setting to sortonServer, but no use. Please help.
Regards
Biju Koshy
There is no need to change any of those properties. Have them set to values which enable clicking on the header. Whether sorting is performed on the server or on the client is determined by the AllowSortingDefault property. You can find more information about the possible values it can take in this topic http://help.infragistics.com/NetAdvantage/ASPNET/2010.3/CLR4.0/?page=Infragistics4.WebUI.UltraWebGrid.v10.3~Infragistics.WebUI.UltraWebGrid.AllowSorting.html.
In your case it should be set to Yes. To make it the default value for the control you should browse the properties for the WebGrid in the Designer and find it under DisplayLayout.
The aspx page will then look like this:
<igtbl:UltraWebGrid ID="UltraWebGrid1" runat="server"> <displaylayout AllowSortingDefault="Yes" ...
<igtbl:UltraWebGrid ID="UltraWebGrid1" runat="server">
<displaylayout AllowSortingDefault="Yes" ...
On a side note, instead of implementing a sorting algorithm of your own you may first check those supported by WebGrid and see if any of them works quickly enough in your particular case.
You can find more information about the supported algorithms in this topic http://help.infragistics.com/NetAdvantage/ASPNET/2010.3/CLR4.0/?page=WebGrid_Predefined_Sorting_Algorithms.html.
Which algorithm is used is determined by the SortingAlgorithmDefault property. It can be found under DisplayLayout as well. If you wish you can manually edit the value in the aspx page and as an example if you decide to use Bubble Sort it will look like this:
<igtbl:UltraWebGrid ID="UltraWebGrid1" runat="server"> <displaylayout AllowSortingDefault="Yes" SortingAlgorithmDefault="BubbleSort" ...
<displaylayout AllowSortingDefault="Yes" SortingAlgorithmDefault="BubbleSort" ...
Best regards,
Stamen Stoychev
But my problem is if I put header Click Action = "Not set" or "select", the header is disabled. I wont be able to click on the header at all, once the header is enabled then only I can click and it will do the custom event. For getting the header enabled I need to put Header Click action = "SortSingle" then first it will do the client sorting and then only it will come to the custom event. Please suggest. Thanks.
You don't need to make any other changes than those shown in the help document.
In the example there, the MySortAlgorithm method will be called internally each time the grid needs to be sorted.
Thanks. Could you please tell me what changes needs to be done in Designer page(aspx page). What should be the header click action?
Hello Biju,
This topic http://help.infragistics.com/NetAdvantage/ASPNET/2010.3/CLR4.0/?page=WebGrid_Defining_a_Custom_Sorting_Algorithm_Server_Side.html should help you implement custom server-side sorting for your WebGrid.
Please, let me know if you need any further assistance.