How Do I Disable Column Sorting?
This lesson will show you how to disable column sorting in a Data Grid table.
Sort By No Column
Edit Data Grid Script
Add SortDataGridColumn Handler
When the user clicks on a table column header the SortDataGridColumn message is sent to the Data Grid. By intercepting the message and not passing it you will effectively disable sorting. For more information about how SortDataGridColumn works please see this lesson.
Add the following code to your Data Grid group script and compile.
Copy & Paste
on SortDataGridColumn pColumn
Now when you click on the table header the data will not be sorted.
Note: Once you add the SortDataGridColumn handler to a Data Grid setting the dgProp["sort by column"] property will no longer do anything. If you need to set the "sort by column" property later on you would need to remove the SortDataGridColumn handler from the script, or at least pass the message.