Sir,
I want to group the rows in the WinGrid, based on a column in the Gird.
Eg.. I have a dataset, with columns Name, Address, City, State...
Now i want to Group the record based on State and then with in the State, i want to group by City.. I dont want to provide the group by box to the user. i want to group it by myself in the code.
Kindly help me to resolve this issue...
Thanks
R.Vasanth
Hi Mike,
In case of I have a Dataset and I know what column user want to group, so How I do my custom grouping for grid but still using the group appearance of the grid?
I can do it with filter like that:
1. Override the RowFilterAction: this.ultraGrid1.DisplayLayout.Override.RowFilterAction = RowFilterAction.AppearancesOnly;
2. Insert my code to BeforeSortChange event
// Custom sorting DataView dv = this.nwindDataSet.Tables[0].DefaultView; dv.RowFilter = temp; this.ultraGrid1.DataSource = dv;
Can I do like that for Grouping in the Grid?
Thanks a lot.
Dan
You should post WebGrid question in the WebGrid forum. This forum is for WinGrid.
Hi,
Do you have similar functionality for a web grid? I don't see the overloaded boolean parameter for GroupBy in the Add() Method. Please help.
Thanks in advance.
To group a column in code, you add it to the SortedColumns collection. The add method has an overload that take a boolean parameter for GroupBy. So it looks something like this.
private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { e.Layout.Bands[0].SortedColumns.Add("My Column", false, true); }