I am trying to emulate the insert button press on a gridview where the insert button is pressed, a new row is added to the grid, the row is selected, it goes into edit mode, and the first cell has the cursor sitting in it ready for data input.
I'm using Ria Services and supplying a QueryableCollectionView to the grid's ItemsSource so that paging an filtering all work. Of course, the insert key doesn't work here automatically, so I want to do an insert in code behind.
I'm capturing the <insert> button press using the AddingNewDataItem event handler. I have successfully added the new data item into the collection using e.NewObject. The grid shows the new row at the top of the grid. However, it's not selected and the row is not in edit mode and the cursor is not sitting in the first cell... How do I do this last but important part?
I found some code way back from May which suggested using ChildrenOfType but I can't find the method. I've added all the Telerik assemblies I could find but I could not find one that resolves it. I've now assumed that things have changed in the new SL stuff and that this may now not be available/the way to do it.
How do I get the new row selected and in edit mode?
Thanks, Steve
I'm using Ria Services and supplying a QueryableCollectionView to the grid's ItemsSource so that paging an filtering all work. Of course, the insert key doesn't work here automatically, so I want to do an insert in code behind.
I'm capturing the <insert> button press using the AddingNewDataItem event handler. I have successfully added the new data item into the collection using e.NewObject. The grid shows the new row at the top of the grid. However, it's not selected and the row is not in edit mode and the cursor is not sitting in the first cell... How do I do this last but important part?
I found some code way back from May which suggested using ChildrenOfType but I can't find the method. I've added all the Telerik assemblies I could find but I could not find one that resolves it. I've now assumed that things have changed in the new SL stuff and that this may now not be available/the way to do it.
How do I get the new row selected and in edit mode?
Thanks, Steve
private void rgvProperties_AddingNewDataItem(object sender, Telerik.Windows.Controls.GridView.GridViewAddingNewEventArgs e) |
{ |
rtp_Properties newProperty = new rtp_Properties(); |
e.NewObject = newProperty; |
//var rgv = this.rgvProperties; |
//rgv.ChildrenOfType<GridViewNewRow>().First().BeginEdit(); |
} |