Hi, Actually i am using your UltraGrid. In run time i m able to drag the column to "Drag a column header here to Group by that Column" but my i want to set header column by using coding. so can u plz provide me which code i used to set the Group by column programatically. Thanks, Waiting Your Reply,
Grouping and sorting and very closely related. So to group a column, you use the SortedColumn.Add method.
grid.DisplayLayout.Bands[0].SortedColumns.Add("My Column", true, true);
Thanks
hey i am trying to get the column name that user want to group by when he Drag a column header into the ultragrid who can i do this please some help thx
You can handle the BeforeSortChanged event and examine the event arguments to determine what the new sorted state will be. To determine if a column is grouped, you use the IsGroupByColumn property on the column.
hey
wen i create this event the designe code give me an error Error 6 'Infragistics.Win.UltraWinGrid.BeforeSortChangeEventArgs' does not contain a constructor that takes '1' plz any help thanks
Hello Mo_Mo,
Probably you would be able to do something like the following:
ultraGrid1.BeforeSortChange += new Infragistics.Win.UltraWinGrid.BeforeSortChangeEventHandler(ultraGrid1_BeforeSortChange); void ultraGrid1_BeforeSortChange(object sender, Infragistics.Win.UltraWinGrid.BeforeSortChangeEventArgs e) { //Verifying the SortOrder of the Column if (e.SortedColumns[0].SortIndicator == Infragistics.Win.UltraWinGrid.SortIndicator.Ascending) { } //Verifying if the Column is GroupedBy if (e.SortedColumns[0].IsGroupByColumn) { } }
Please let me know if you need any other assistance.
thx for your help it's working now