Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
40
Set Focus to a specific cell
posted

Hi

I'm looking to force the user into a specific cell of a row when the grid is loaded and when the row changes. What are the best events to use for both of these options?

Bit of info - I have 2 non-disabled columns(NewEstimate and EstimatePercent) in the grid but want the user to be in NewEstimate ready to edit on grid load and any row change method, perform action click etc

Thanks

Parents
No Data
Reply
  • 469350
    Suggested Answer
    Offline posted

    You would do something like this:

    this.ultraGrid1.Rows[0].Cells["NewEstimate"].Activate();

    this.ultraGrid1.PerformAction(EnterEditMode);

    The tricky part of this is when to do it. This code will not work in the Form_Load event, for example, because Visual Studio does not allow you to set focus to a control in that event. So one thing you can do to get around that is to call a method via a BeginInvoke call, rather than calling this code directly from inside the event.

     

Children
No Data