Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
16905 | Jul 27,2004 09:32 AM UTC | Jul 29,2004 07:10 AM UTC | WinForms | 12 |
![]() |
Tags: GridControl |
this.gridControl1[2,13].CellType = "GridinCell";
//this.gridControl1[2,6].CellType = "GridinCell";
//this.gridControl1.CoveredRanges.Add(GridRangeInfo.Cells(2, 6, 5, 8));
grid = new CellEmbeddedGrid(this.gridControl1);
grid.BackColor = Color.FromArgb(0xee, 0x7a, 0x02);
grid.RowCount = 5;
//grid.ColCount = 5;
grid.ColCount = 25;
grid[1,1].Text = "this is a 5x5 grid";
grid.ThemesEnabled = true;
//this.gridControl1[2,6].Control = grid;
this.gridControl1[2,13].Control = grid;
this.gridControl1.Controls.Add(grid);
//only call baseclass if no current cell
//if(!this.activeGrid.CurrentCell.HasCurrentCell)
if(this.activeGrid == null || !this.activeGrid.CurrentCell.HasCurrentCell)
base.OnClick(rowIndex, colIndex, e);
protected override void OnClick(int rowIndex, int colIndex, MouseEventArgs e) { if(this.activeGrid == null) { GridStyleInfo style = this.Grid.Model[rowIndex, colIndex]; if (style.Control is CellEmbeddedGrid) { activeGrid = style.Control as CellEmbeddedGrid; activeGrid.CurrentCell.MoveTo(1,1); } } if( !this.activeGrid.CurrentCell.HasCurrentCell) base.OnClick(rowIndex, colIndex, e); }
protected override void OnClick(int rowIndex, int colIndex, MouseEventArgs e) { base.OnClick(rowIndex, colIndex, e); }Now the main grid has to scroll to show the start of the top-left of the covered cell. There is no way around this. If this does not happen, then there are drawing problems at the row header for the main grid. What I see with the above code when I click into the child is the main grid scrolls to expose the top-left cell of the covered range, and then after the scroll the child grid selects the cell under the mouse at that point (which is different than the cell under the original click as that is now scrolled off the screen). I am using version 2.0.5.1 of our libraries.
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.