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

How to do insert/delete when using DataForm as GridView RowDetails

5 Answers 226 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
Jeff
Top achievements
Rank 1
Jeff asked on 25 Jan 2012, 10:24 PM
Your example "DataForm Integration with RadGridView row-details" looks very nice, but it has a major shortcoming.

It doesn't show how to insert new rows, or how to delete existing rows.

I've been trying to work it out for some hours, now, and am back where I started.

Any ideas?

5 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 26 Jan 2012, 08:09 AM
Hello Jeff,

Please take a look at this demo for a reference as well. 

Regards,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Jeff
Top achievements
Rank 1
answered on 26 Jan 2012, 05:20 PM
I've been looking at that, and I've almost got it working, but that's a very different UI.

Am I correct in thinking that the DataForm, when used as a row detail, doesn't have insert or delete functionality, because it's bound to a single record?  And that we'd need to tie the insert and delete functionality to the GridView?
0
Maya
Telerik team
answered on 27 Jan 2012, 08:59 AM
Hi Jeff,

In the demo both RadGridView and RadDataForm are bound to ICollectionView that enables their synchronization. You wan insert an item from the two controls as well. Do you experience any different behavior on your side ? 

 

Regards,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Jeff
Top achievements
Rank 1
answered on 27 Jan 2012, 05:30 PM
I can't see any reason why I'd want to allow both the grid and the form to edit the data.  My most likely use case would be for the grid to provide an overview - that likely would not have a column for every field in the underlying data - and to use only the form for editing.

Whether the form would appear within the grid, as row detail, or below the grid, as in you synch demo, is, in my mind, purely a stylistic concern.  Except, of course, that I'd not expect navigation controls on the form, if it was appearing as row detail.  And from that it would follow that the insert and delete behaviors would have to be tied to the grid, and not to the form.

Still, I have been trying to get your synchronization example to work, and I've been having an odd problem with adding new records, that I have not been able to replicate using your demo code.

http://www.telerik.com/community/forums/wpf/gridview/icollectionview-synchronization-with-dataform.aspx
0
Maya
Telerik team
answered on 31 Jan 2012, 09:39 AM
Hello Jeff,

Basically, when RadDataForm is defined as illustrated in the demo, it has ItemsSource (the same as the one of the grid) and you can insert and delete items from it. However, when it is defined as in this case, it has only CurrentItem.
The idea of the demo is to illustrate how with the help of ICollectionView that keeps track of the current item, you can synchronize the two controls and add or remove item either from RadDataForm or with RadGridView, or from both. 

Regards,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
DataForm
Asked by
Jeff
Top achievements
Rank 1
Answers by
Maya
Telerik team
Jeff
Top achievements
Rank 1
Share this question
or