Hi,
I have an urgent requirement as described under.
I have two bands in my grid and headers for the child band are made visible false.
On Sort of the parent band column(i.e. when we click on the header of the parent column) I need to sort one of the related column of child band.Please let me know the way this can be done.
need urgently. any help would be appreciated.
Thanks
Pravin
Hello Pravin,
I wanted to know if you were able to solve your issue based on these suggestions or you still need help. Please let me know.
Could you please try out the following code sample:
private void ultraGrid1_AfterSortChange(object sender, Infragistics.Win.UltraWinGrid.BandEventArgs e) { if (e.Band.Index == 0) { foreach (UltraGridColumn col in e.Band.SortedColumns) { ultraGrid1.DisplayLayout.Bands[1].SortedColumns.Clear(); switch (col.SortIndicator) { case SortIndicator.Descending: ultraGrid1.DisplayLayout.Bands[1].SortedColumns.Add(ultraGrid1.DisplayLayout.Bands[1].Columns[col.Index], true); break; case SortIndicator.Ascending: ultraGrid1.DisplayLayout.Bands[1].SortedColumns.Add(ultraGrid1.DisplayLayout.Bands[1].Columns[col.Index], false); break; } } } }
I also attached a sample to this post to make sure that everything is fine with this approach.
Please do not hesitate to contact me if you need any additional assistance.
The event fires after the sorting has changed. So you don't need the event args to give you the sorting information, all you need to know is which band was sorted, and the event args give you that.
To see which columns are sorted, you examine the band's SortedColumns collection. On each column, you will want to look at the SortIndicator to determine the direction of the sort.
Thanks for the reply,
In after sort change event, the event argument dos not expose any thing related to the column info which is being sorted.
Can you please give me some code snippet for more understanding.
thanks
Hi Pravin,
What you can do is handle the AfterSortChanged event of the grid. You could trap for changes to the sorting of the parent band and then sort the child band any way you like.