Hi Simbu,
Even though you want only one column sorted, you're actually performing a multi-sort. First by the type of info (directory or file), and then by name. As such, you can have the data grid do this for you. What you will need to do is add another bound data column that has this type for each row. You can sett Hidden="true" on it so that the end user cannot see it. You'll also need to set SortingMode to multi on sorting. Then in the ColumnSorted Server event, you'll want something like this. Your type col could be a string with "dir" and "file" for values to get the sorting you see in your picture or even just an int with "0" and "1".
protected void WebDataGrid1_ColumnSorted(object sender, SortingEventArgs e) { if (e.Column.Key == "Name") { Infragistics.Web.UI.SortDirection dir = e.SortedColumns[e.Column.Key].SortDirection; e.SortedColumns.Clear(); e.SortedColumns.Add("Type", dir); e.SortedColumns.Add(e.Column.Key, dir); }
}
Let us know if you have any trouble getting this to work.
regards,David Young
Hi David Young, Thanks a lot for your help. Now the sorting is working fine as expected but I couldn't hide the "Type" column as you suggested. Below is the piece of code I included to hide the "Type" column. Also I couldn't bind the data using 'boundData' column for "Type" column as you mentioned your reply. < ig:TemplateDataField Key="Type" Hidden="true">
Hi David Young,
Thanks a lot for your help. Now the sorting is working fine as expected but I couldn't hide the "Type" column as you suggested.
Below is the piece of code I included to hide the "Type" column. Also I couldn't bind the data using 'boundData' column for "Type" column as you mentioned your reply.
<
please help me out to hide the column.