We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Set focus of SubGrid

Thread ID:





6392 Aug 11,2003 02:43 PM Aug 11,2003 09:21 PM Windows Forms 4
Tags: GridControl
Asked On August 11, 2003 02:43 PM

I have a dropdown grid cell in a root grid (non-databound), which shows a databound "subgrid". I want this subgrid to become the focus when its dropped. I've tried calling subgrid.Focus() and subgrid.Select() in the SubGrid_VisibleChanged() handler, and in the root grid's _CurrentCellShowingDropDown handler, but that doesn't have any effect. Also... How do I select a specific cell in the subgrid (remember, it's a databound grid) Thanks Eric

Administrator [Syncfusion]
Replied On August 11, 2003 04:51 PM

In CurrentCellShowingDropDown, after the subgrid has been populated, try calling subGrid.ForceCurrentCellMoveTo = true; subGrid.CurrentCell.MoveTo(1,1);

Replied On August 11, 2003 05:24 PM

Doesn't do it. When the subgrid appears, it doesn't truly have the focus. Hitting the right arrow, for example, closes the subgrid and moves the cursor over on the main grid. Any other ideas? Eric

Administrator [Syncfusion]
Replied On August 11, 2003 06:13 PM

Try the CurrentCellShowedDropDown event. This code worked for me in the DropDownGrid sample. And it also worked when I switched the dropped grid to a GriddataBoundGrid.
private void gridControl1_CurrentCellShowedDropDown(object sender, System.EventArgs e)
	GridCurrentCell cc = this.gridControl1.CurrentCell;
	if(this.gridControl1[cc.RowIndex, cc.ColIndex].CellType == "GridADropCell")
		GridA.ForceCurrentCellMoveTo = true;
Without the focus call, the currentcell shows with a dotted border meaning the grid does not have focus.

Replied On August 11, 2003 09:21 PM

perfect...I should have seen the "Showed" method. Thanks Eric


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.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.