Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
17574 | Aug 12,2004 10:15 AM UTC | Aug 12,2004 02:28 PM UTC | WinForms | 3 |
![]() |
Tags: GridControl |
this.gridControl1.Model.Options.MergeCellsMode = GridMergeCellsMode.OnDemandCalculation|GridMergeCellsMode.MergeRowsInColumn;
this.gridControl1.ColStyles[2].MergeCell = GridMergeCellDirection.RowsInColumn;
Here is a sample that has both a GridControl and a GridDataBoundGrid in it. Similar merge techniques work for each control.
private void gridDataBoundGrid1_PrepareViewStyleInfo(object sender, GridPrepareViewStyleInfoEventArgs e) { if(e.ColIndex == 2 && e.RowIndex > 1 && this.gridDataBoundGrid1[e.RowIndex, e.ColIndex].Text == this.gridDataBoundGrid1[e.RowIndex - 1, e.ColIndex].Text) { e.Style.Text = ""; } } private void gridDataBoundGrid1_CurrentCellStartEditing(object sender, CancelEventArgs e) { GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell; if(cc.ColIndex == 2 && cc.RowIndex > 1 && this.gridDataBoundGrid1[cc.RowIndex, cc.ColIndex].Text == this.gridDataBoundGrid1[cc.RowIndex - 1, cc.ColIndex].Text) { e.Cancel = true; } }
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.