Set Current Cell

2 posts, 1 answers
  1. REIMANN
    REIMANN avatar
    3 posts
    Member since:
    Nov 2013

    Posted 26 Nov 2013 Link to this post

    Hello,

    I have a GridView on which I want to set programmatically the CurrentCell. I have found a solution using this metohd 

    public void SetCurrentCell(int rowIndex, string columnName)
    {
         CurrentRow = Rows[rowIndex];
         CurrentColumn = Columns[columnName];
    }

    But using this method fires twice the CurrentCellChanged event which it is not desirable.
    Is there other way to do this to simulate the Mouse Click which does not fire twice the CurrentCellChanged?

    Thanks in advance


  2. Answer
    Dimitar
    Admin
    Dimitar avatar
    2913 posts

    Posted 29 Nov 2013 Link to this post

    Hi Reiman,

    Thank you for contacting Telerik support.

    To achieve the desired behavior you can select the current cell by using the Select method of the GridNavigator:
    this.radGridView1.GridNavigator.Select(this.radGridView1.Rows[2], this.radGridView1.Columns[0]);

    I hope this information helps. Should you have any other questions, I will be glad to assist you.

    Regards,
    Dimitar
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top