Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
3862 | Apr 15,2003 03:55 AM UTC | Apr 15,2003 03:55 PM UTC | WinForms | 3 |
![]() |
Tags: GridControl |
//in the embedded grid's constructor parent.CellClick += new GridCellClickEventHandler(ClickedOnParentCell); //the handler private void ClickedOnParentCell(object sender, GridCellClickEventArgs e) { Point pt = this.PointToClient(Control.MousePosition); if(this.GridBounds.Contains(pt)) { int row, col; if(this.PointToRowCol(pt, out row, out col, 1)) { this.CurrentCell.MoveTo(row, col, GridSetCurrentCellOptions.SetFocus); } } }2) In the embedded grid'c constructor, set its WrapCellBehavior property, and hook the WrapNextControlInForm event and handle the moving the the event handler.
//in the constructor this.Model.Options.WrapCellBehavior = GridWrapCellBehavior.NextControlInForm; this.WrapCellNextControlInForm += new GridWrapCellNextControlInFormEventHandler(TabToNextParentCell); //handler private void TabToNextParentCell(object sender, GridWrapCellNextControlInFormEventArgs e) { GridControl grid = (GridControl) this.Parent; grid.Focus(); if(e.Forward) grid.CurrentCell.MoveRight(1); else grid.CurrentCell.MoveLeft(1); 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.