This is a migrated thread and some comments may be shown as answers.

Radgrid calling SortCommand event Handler...

1 Answer 154 Views
Grid
This is a migrated thread and some comments may be shown as answers.
raaj
Top achievements
Rank 1
raaj asked on 15 Oct 2010, 05:01 PM
Team

One of our client wants to apply sorting while click the link button of the first column

How can I call the Sort Command EventHandler when they click Financial Date YYYY (1st Column) link column. LinkButton.

In the Screenshot attached..

Note: All the Columns are AutoGenerated. We are not using ItemTemplates at all..

Its very critical time for me. Pls. help.

Thanks
 

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 18 Oct 2010, 01:50 PM
Hello,


One simple method to achive the functionality is invoking sort from client side after checking the columnuniquename.

JavaScript:
<script type="text/javascript">
    function OnColumnClick(sender, args) {
        if (args.get_gridColumn().get_uniqueName() == "ColumnUniqueNameHere") {
            var masterTable = sender.get_masterTableView();
            masterTable.sort(args.get_gridColumn().get_uniqueName());
        }
    }
</script>
Attach OnColumnClick method to grid client event.


Thanks,
Princy.
Tags
Grid
Asked by
raaj
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or