Hi,
I've found a bug with the ShowInsertRow property, which I hope you can fix ASAP.
BUG
When setting ShowInsertRow="False" in XAML, you can easily make it visible again after adding a new row.
STEPS TO REPRODUCE
1. Hook up a RadButton as below...
2. Now click the above button to insert a new row.
3. Now click any column header to sort by that row.
4. The ShowInsertRow is now visible.
After further testing this seems to relate to when the AddingNewDataItem event is handled in the behind. The code below runs on insert then if you click cancel button (via telerik:RadGridViewCommands.CancelRowEdit command) the ShowInsertRow is made visible.
Also when you click save button (telerik:RadGridViewCommands.CommitEdit command) - an unhandled exception is thrown - due to the CurrentColumn being set. Take this last line out and you don't get the error!.
I've found a bug with the ShowInsertRow property, which I hope you can fix ASAP.
BUG
When setting ShowInsertRow="False" in XAML, you can easily make it visible again after adding a new row.
STEPS TO REPRODUCE
1. Hook up a RadButton as below...
<
telerik:RadButton
Content
=
"Add"
Margin
=
"0,0,5,0"
Command
=
"telerik:RadGridViewCommands.BeginInsert"
CommandTarget
=
"{Binding ElementName=MyGridView}"
Width
=
"45"
/>
2. Now click the above button to insert a new row.
3. Now click any column header to sort by that row.
4. The ShowInsertRow is now visible.
After further testing this seems to relate to when the AddingNewDataItem event is handled in the behind. The code below runs on insert then if you click cancel button (via telerik:RadGridViewCommands.CancelRowEdit command) the ShowInsertRow is made visible.
private void MyRadGridView_AddingNewDataItem(object sender, Telerik.Windows.Controls.GridView.GridViewAddingNewEventArgs e)
{
var grid = e.OwnerGridViewItemsControl;
e.NewObject = ViewModel.CreateNewRecord();
_newRecord = e.NewObject as MyObject;
//grid.CurrentColumn = grid.Columns[0]; //Causes an error on Save command
}
Also when you click save button (telerik:RadGridViewCommands.CommitEdit command) - an unhandled exception is thrown - due to the CurrentColumn being set. Take this last line out and you don't get the error!.