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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Set focus of SubGrid

Thread ID:





6392 Aug 11,2003 06:43 PM UTC Aug 12,2003 01:21 AM UTC WinForms 4
Tags: GridControl
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);

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.ForceCurrentCellMoveTo = true;
Without the focus call, the currentcell shows with a dotted border meaning the grid does not have focus.

Replied On August 12, 2003 01:21 AM UTC

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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon