I have "Product" Textbox where the user type Product Name. When the user press enter, this "Product" will be added to the GridView and auto-focus to "Quantity "cell. (I've successfully developed this part.)
After the user type Quantity in GridView's Cell, I want to CommitEdit to this row and focus return back to "Product" textbox. This is the part that I don't know how to do it.
Currently I have tried something like the following:
private void RadGridViewInvoiceItems_CellEditEnded( object sender, GridViewCellEditEndedEventArgs e )
{
if ( e.Cell.Column.Header.ToString() == "Quantity" )
{
this.gridView.CommitEdit();
this.productTextBox.Focus();
}
}
But the above code cause "StackOverFlow" exception. How should I solve this problem?
P.S. I have developed this app with C# Wpf with MVVM pattern and Telerik controls.