Below is the code i have created and wanted to group it based on "name" column. But i am not able to group it and normal values are being rendered in the grid...
| RadGrid radGrid1 = new RadGrid(); |
| radGrid1.ID = "radgrid1"; |
| radGrid1.DataSourceID = "SqlDataSource1"; |
| radGrid1.GridLines = GridLines.None; |
| GridTableView gridTableView = new GridTableView(radGrid1); |
| gridTableView.GroupsDefaultExpanded = true; |
| gridTableView.DataSourceID = "SqlDataSource1"; |
| GridGroupByExpression expression = new GridGroupByExpression(); |
| GridGroupByField gridGroupByField = new GridGroupByField(); |
| gridGroupByField = new GridGroupByField(); |
| gridGroupByField.FieldName = "name"; |
| gridGroupByField.HeaderText = "Name"; |
| expression.SelectFields.Add(gridGroupByField); |
| gridGroupByField = new GridGroupByField(); |
| gridGroupByField.FieldName = "name"; |
| gridGroupByField.HeaderText = "Name"; |
| expression.GroupByFields.Add(gridGroupByField); |
| gridTableView.GroupByExpressions.Add(expression); |
| this.Controls.Add(radGrid1); |
Thanks a million in advance.