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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Set focus of SubGrid

Thread ID:

Created:

Updated:

Platform:

Replies:

6392 Aug 11,2003 06:43 PM UTC Aug 12,2003 01:21 AM UTC WinForms 4
loading
Tags: GridControl
ERobishaw
Asked On August 11, 2003 06:43 PM UTC

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 08:51 PM UTC

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

ERobishaw
Replied On August 11, 2003 09:24 PM UTC

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 10:13 PM UTC

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 12, 2003 01:21 AM UTC

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.

Warning Icon 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.Close Icon

;