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

cannot delete or insert row in "Add new row" state

5 Answers 84 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Stefan
Top achievements
Rank 1
Stefan asked on 12 Dec 2012, 05:48 AM
Hello,

i have a gridview with ShowInsertRow behavoir
Grid binded to ObservableCollection.

User clicked fixed New row.
i tried to add or delete rows to/from my observable collection in this time(grid is focused on fixed new Row, but user dont makes entries) and dont see any updates.

5 Answers, 1 is accepted

Sort by
0
Yoan
Telerik team
answered on 14 Dec 2012, 02:02 PM
Hello Stefan,

In order to make it clear, would you please specify when you want to add/remove items from the collection? However, I have prepared a sample project with GridView binded  to a collection of Clubs. You can find it attached. As you can see I have subscribed to the AddingNewDataItem event. I am removing a item from my collection in this event. May I ask you to modify the attached project in order to reproduce the problem and resend it back to me?

Kind regards,
Yoan
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Stefan
Top achievements
Rank 1
answered on 17 Dec 2012, 11:11 AM
hello,

1. go to new row
2. use context menu, i cant add new row.
Or make dispatcher timer, in dispatcher timer event i cant add new row also.

http://ysoft.de/RadGridView_WPF_AR_6.zip
0
Yoan
Telerik team
answered on 19 Dec 2012, 03:24 PM
Hi Stefan,

Actually, you can not add new row to GridView while a row is in edit mode. In your case you can execute the CommitEdit method when you open the context menu. Please check the following code snippet for a reference:

private void RadContextMenu_Opening(object sender, Telerik.Windows.RadRoutedEventArgs e)
       {
           RadContextMenu menu = (RadContextMenu)sender;
           GridViewRow row = menu.GetClickedElement<GridViewRow>();
           if (row != null)
           {
               row.IsSelected = true;                
           }
           else
               e.Handled = true;
           this.clubsGrid.CommitEdit();
       }

Hope this helps! 


Kind regards,
Yoan
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Stefan
Top achievements
Rank 1
answered on 20 Dec 2012, 12:55 PM
no ;(
the row isnt commited after grid.commitedit
0
Yoan
Telerik team
answered on 20 Dec 2012, 02:15 PM
Hello Stefan,

I am sorry to hear that you have met a problem again.

You can find attached a demo project. Can you reproduce the problem with it?

Regards,
Yoan
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
GridView
Asked by
Stefan
Top achievements
Rank 1
Answers by
Yoan
Telerik team
Stefan
Top achievements
Rank 1
Share this question
or