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

How can I set the focus on a specific cell in my Grid ?

How can I set the cursor in a specific cell ? Thanx !

7 Replies

AD Administrator Syncfusion Team July 13, 2004 07:37 AM

grid.CurrentCell.MoveTo(rowIndex, colIndex) It will also accept a third activation parameter if you want to use that as well.


AD Administrator Syncfusion Team July 13, 2004 08:19 AM

Thanx ! that works I also added Grid.CurrentCell.BeginEdit(); and I see the cursor. But I want the cell to be filled by the user. So I built a check in the CurrentCellValidated-event. But if the user clicks on another cell without any filling of the cell the CurrentCellValidated-event is not fired ? Because the cell didn''t change ? How can I force the event to be always fired ?


AD Administrator Syncfusion Team July 13, 2004 08:37 AM

Try using CurrentCellMoving. This event should be raised anytime the current cell is about to be moved, and you can cancel it by setting e.Cancel = true.


AD Administrator Syncfusion Team July 13, 2004 08:52 AM

That also doesn''t work well if the grid loses focus...


AD Administrator Syncfusion Team July 13, 2004 09:11 AM

In addition to setting CurrentCell.BeginEdit, also try setting CurrentCell.IsModified = true. Then you can handle the CurrentCellValidating event, and it will be hit whether you are moving cell to cell, or out of the grid (provided whatever is getting focus has CausesValidation = true).


AD Administrator Syncfusion Team July 13, 2004 09:27 AM

Thanx !! I will try that (tomorrow)


AD Administrator Syncfusion Team July 14, 2004 12:30 AM

So I tried and it works. Thanx a lot !

Loader.
Live Chat Icon For mobile
Up arrow icon