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:

Created:

Updated:

Platform:

Replies:

6392 Aug 11,2003 02:43 PM Aug 11,2003 09:21 PM Windows Forms 4
loading
Tags: GridControl
ERobishaw
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);

ERobishaw
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.Focus();
		GridA.ForceCurrentCellMoveTo = true;
		GridA.CurrentCell.MoveTo(1,1);
	}
}
Without the focus call, the currentcell shows with a dotted border meaning the grid does not have focus.

ERobishaw
Replied On August 11, 2003 09:21 PM

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

CONFIRMATION

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.

;