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

Calling CurrentCell.MoveTo when grid not focused

I have a GDBG that I filter using a TextBox. As the user types in the TextBox, I filter the DataView. The GDBG is using the fullrow highlighting trick of hooking CellActivated, CellMoving, CellDeactived, etc. I want to ensure that the first row in the grid is selected once the user filters the grid, so I attempt a call to grid.CurrentCell.MoveTo(1, 1) but it will not highlight the row unless the grid is focused. Is my approach flawed or is there another approach that would be better? Sean

3 Replies

AD Administrator Syncfusion Team June 25, 2003 02:19 PM

Sean, I tried to reproduce the problem in the attached sample and could not. Is your grid or textbox in some other containers than a Form like this sample?


SG Sean Greer June 25, 2003 03:10 PM

Clay, If you change the tab order so that the TextBox receives focus on load, you'll see the problem that I describe. Thanks, Sean


AD Administrator Syncfusion Team June 25, 2003 04:18 PM

I added this.gridDataBoundGrid1.ForceCurrentCellMoveTo = true; to the bottom of Form_Load, and then the CurrentCell.MoveTo in TextBox_Changed worked as expected. Also, if you want to initially see the selected row in the grid, you can also add a this.gridDataBoundGrid1.CurrentCell.MoveTo(1,1); in FormLoad as well.

Loader.
Live Chat Icon For mobile
Up arrow icon