The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
How to I disabled sorting in the grid from the UI. I want to prevent the grid from sorting when the user click on the header but still be able to do it programatically!
ADAdministrator Syncfusion Team December 18, 2006 06:18 AM UTC
Hi James,
This can be achieved by setting the AllowSortColumns property to false. This disables the sorting of columns in User Interface, it also allows to sort programmatically. The following is the code snippet.
Also please refer to our shipped browser sample 'SortingMethods' [ \\windows\Grid.Grouping.Windows\Samples\Sorting\SortingMethods ] for more details.
Thank you for being patience.
Best regards, Madhan
JBJames BliboDecember 21, 2006 02:59 AM UTC
Actually, my question was wrong... I want to selectively permit certain columns to be sortable and other to not be sortable. The solution that you provided is an all or nothing.
ADAdministrator Syncfusion Team December 21, 2006 07:14 AM UTC
Hi James,
Thanks for your response. This can be achieved by handling the TableControlQueryAllowSortColumn event and cancel the sorting for the required columns.
Please try the following code snippet and let us know if you need any further assistance. >>>>>>>>>>>>>>>>>Code Snippet 1<<<<<<<<<<<<<<<<<<< // Form_Load Event this.gridGroupingControl1.TableOptions.AllowSortColumns = true; this.gridGroupingControl1.TableControlQueryAllowSortColumn += new GridQueryAllowSortColumnEventHandler(gridGroupingControl1_TableControlQueryAllowSortColumn); // TableControlQueryAllowSortColumn Event void gridGroupingControl1_TableControlQueryAllowSortColumn(object sender, GridQueryAllowSortColumnEventArgs e) { if (e.Column.Name == "Length") e.AllowSort = false; } >>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<