Hi,
I've got this from another thread and wanted to ask further questions (see below), hence this new thread. Here's the code:
And in terms of sorting, take a look at the sorting.aspx example.
Its set up is the same as regular gridview controls. And when load datasource, you set up the sort column
function loadData()
{
//Need to convert the sortoder so our WS understand
var sortColumn = _gridView.get_sortColumn();
var sortOrder = (_gridView.get_sortOrder() == AjaxDataControls.GridViewSortOrder.Descending) ? 'DESC' : 'ASC';
DataService.GetData(0, 1000, sortColumn, sortOrder, onLoadSuccess);
}
function onSortCommand(sender, e)
{
_gridView.set_sortColumn(e.get_sortColumn())
_gridView.set_sortOrder(e.get_sortOrder());
loadProducts();
}
My first question is, how do I set which columns should be sorted on the GridView? Do I do this in the properties of the gridview in design view?
Secondly, could you explain why the sortColumn and sortOrder are passed to the webservice method? What does the method need to do and return?
Lastly, could you give me a brief overview fo how this all fits together?
Thanks.