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
115
Focus on AddNew Row
posted

What is the syntax for setting focus to the first cell in a xamDataPresenter addnew row once a previous row has been added?

Thanks,

Greg Tingle

 

Parents
  • 69686
    posted

    Hello Greg,

    You have to do couple of things to achieve this.

    1) Handle the RecordAdded event and store locally the currently added record:

    DataRecord dr;

    ...

    void xamDataGrid1_RecordAdded(...)

     {

         dr = e.Record;

    }

    2. Handle RecordUpdated event and check if the updated record is the currently added one. After this record is updated, you can start edit mode of the AddNewRecord UI like this:

    void xamDataGrid1_RecordUpdated(...)

    {

          if (e.Record == dr)

          {

                xamDataGrid1.RecordManager.CurrentAddRecord.Cells[0].IsActive = true;

                xamDataGrid1.ExecuteCommand(DataPresenterCommands.StartEditMode);

           }

    }

    Hope this helps.

Reply Children