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

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

Thread ID:





16331 Jul 13,2004 11:11 AM UTC Jul 14,2004 04:30 AM UTC WinForms 7
Tags: GridControl
Administrator [Syncfusion]
Asked On July 13, 2004 11:11 AM UTC

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

Administrator [Syncfusion]
Replied On July 13, 2004 11:37 AM UTC

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

Administrator [Syncfusion]
Replied On July 13, 2004 12:19 PM UTC

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 ?

Administrator [Syncfusion]
Replied On July 13, 2004 12:37 PM UTC

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.

Administrator [Syncfusion]
Replied On July 13, 2004 12:52 PM UTC

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

Administrator [Syncfusion]
Replied On July 13, 2004 01:11 PM UTC

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).

Administrator [Syncfusion]
Replied On July 13, 2004 01:27 PM UTC

Thanx !! I will try that (tomorrow)

Administrator [Syncfusion]
Replied On July 14, 2004 04:30 AM UTC

So I tried and it works. Thanx a lot !


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