I have a problem with sorting in WHDG. I'm binding DataTable that are sorted by Department, Workplace and EmployeeName. In WDHG are data grouped by Department and Workplace (data are sorted correctly). But problem is that employee name are not sorted. I'm not using any sorting behavior because, I don't want to enable sorting to customer.
Hi los_milanos,
In order to ensure that your data is sorted by some criteria, I would suggest that you use client-side code to sort the child grid of each expanded parent row. That would require having sorting enabled, but sorting itself can be cancelled using the ColumnSorting client-side event:
function WebHierarchicalDataGrid1_Sorting_ColumnSorting(sender, eventArgs) { //cancels user sorting eventArgs.set_cancel(true);} function //when a parent row is epxanded, sort the child by its first column, i.e. ProductNameeventArgs.get_row().get_rowIslands()[0].get_behaviors().get_sorting().sortColumn(eventArgs.get_row().get_rowIslands()[0].get_columns().get_column(1), 1);} WebHierarchicalDataGrid1_ContainerGrid_RowExpanded(sender, eventArgs){
function
//when a parent row is epxanded, sort the child by its first column, i.e. ProductNameeventArgs.get_row().get_rowIslands()[0].get_behaviors().get_sorting().sortColumn(eventArgs.get_row().get_rowIslands()[0].get_columns().get_column(1), 1);}
I am attaching my test sample which uses the Northwind DB to illustrate this scenario.
Please let me know if this helps.
Best Regards,
Petar IvanovDeveloper Support EngineerInfragistics, Inc.http://es.infragistics.com/support