This is a migrated thread and some comments may be shown as answers.

Set Current Cell

1 Answer 189 Views
GridView
This is a migrated thread and some comments may be shown as answers.
REIMANN
Top achievements
Rank 1
REIMANN asked on 26 Nov 2013, 01:24 PM
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


1 Answer, 1 is accepted

Sort by
0
Accepted
Dimitar
Telerik team
answered on 29 Nov 2013, 12:34 PM
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 >>
Tags
GridView
Asked by
REIMANN
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or