It might be simple but I haven't found any simple guide about mergind data in a grid.
Could you please provide a list of steps for merging data in a GridDataBoundGrid?
I tried the following but it didn't work.
1) enabling merge option in grid gridDataBoundGrid1.Model.Options.MergeCellsMode = GridMergeCellsMode.MergeRowsInColumn;
2) declaring column to be merged
gridDataBoundGrid1.Binder.InternalColumns.StyleInfo.MergeCell = GridMergeCellDirection.ColumnsInRow;
Do I have to work around any specific event?
Try gridDataBoundGrid1.Binder.InternalColumns.StyleInfo.MergeCell = GridMergeCellDirection.RowsInColumn;
if you want to merge cells vertically.
AdministratorJuly 15, 2003 09:53 AM UTC
I did the change but now a NullReferenceException is being thrown by Grid.GridModelMergeCells.Find
AdministratorJuly 15, 2003 10:12 AM UTC
> Hello Stefan,
> I did the change but now a NullReferenceException is being thrown by Grid.GridModelMergeCells.Find
> Any ideas?
For some reason, after I change the GridModel Options (this.gridDataBoundGrid1.Model.Options.MergeCellsMode = GridMergeCellsMode.BeforeDisplayCalculation|GridMergeCellsMode.MergeRowsInColumn;), there is no exception and it is showing up properly.
Now, if I click on any of the merged cells I still see the value underneath.
How can I hide those merged cell values?
Why the merge operation does not create only one cell merging all data values accordingly?
AdministratorJuly 15, 2003 10:39 AM UTC
You can avoid the cell to start editing and showing a value when clicked on by setting the celltype to static.
gridDataBoundGrid1.Binder.InternalColumns.StyleInfo.CellType = "Static";
If you want it to be a single cell, then you probably should use CoveredCells instead of MergeCells. You can handle the QueryCoverdRange event and dynamically provide the range at that point.