9 Answers, 1 is accepted
You can use the following code:
private
void
Button1_Click(
object
sender, RoutedEventArgs e)
{
var item =
this
.clubsGrid.Items[3];
var column =
this
.clubsGrid.Columns[1];
var cellToEdit =
new
GridViewCellInfo(item, column,
this
.clubsGrid);
this
.clubsGrid.CurrentCellInfo = cellToEdit;
this
.clubsGrid.BeginEdit();
}
We appreciate your feedback and we will consider providing more information on this topic.
Best wishes,
Milan
the Telerik team

So you would like to change the value of that cell using code? If that's the case you can simply work with the data layer and change the properties of the data items instead of working with the UI.
Regards,
Milan
the Telerik team

I am trying to do something similar and this example doesn't work for me. I'm trying to select a certain cell on the CellEditEnd. Is this possible?
private
void
gvInfo_CellEditEnded(
object
sender, Telerik.Windows.Controls.GridViewCellEditEndedEventArgs e)
{
GridViewCell tmpCell = e.Cell;
GridViewRowItem gvri = tmpCell.ParentRow;
DataRowView tmpRow = (DataRowView)gvri.Item;
switch
(tmpCell.Column.UniqueName)
{
case
"UniqueName"
:
{
//I do some data manipulation here
//I want to select a certain cell in the same row here and I know which column I want to select.
}
break
;
case
"UniqueName2"
:
{
//I do some data manipulation here
//I want to select a certain cell in the same row here and I know which column I want to select.
}
break
;
}
}
May you provide a bit more details about the exact goal you want to achieve ? Why do you want to change the current cell on the CellEditEnded event ? What is the behavior you want to get ?
Once I have more information about your scenario, I may be able to provide you with a proper solution.
Maya
the Telerik team

I have many columns in this grid, a few of the columns are editable, but many are not. Most of the columns that are NOT editable are populated with data based off of calculations using the data in the other columns. It's like a giant spreadsheet. When the user enters data into a cell I do a calculation with that data and depending on the result, I need to send the user to a different column to enter more information. For example, if someone enters a 0 into column 1, I need to send them to column 2. But, if they enter a number between 1 - 50 into column 1, I need to send them to column 3. It's like that with most of the columns that are editable.
The reason I do it in the CellEditEnd event is because that is where I do my data manipulation (I do more than just calculations). If there is a better solution for this, I'm willing to try it.
Thanks!

In this case you may set the CurrentColumn instead. However, you will need to predefine the default keyboard behavior as described here.
I am sending you a sample project illustrating the provided suggestion.
Maya
the Telerik team

Thank you, Maya!