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

6 posts, 0 answers
  1. Jeff
    Jeff avatar
    100 posts
    Member since:
    Apr 2008

    Posted 25 Jan 2012 Link to this post

    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?
  2. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 26 Jan 2012 Link to this post

    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 >>

  3. UI for WPF is Visual Studio 2017 Ready
  4. Jeff
    Jeff avatar
    100 posts
    Member since:
    Apr 2008

    Posted 26 Jan 2012 Link to this post

    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?
  5. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 27 Jan 2012 Link to this post

    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 >>

  6. Jeff
    Jeff avatar
    100 posts
    Member since:
    Apr 2008

    Posted 27 Jan 2012 Link to this post

    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
  7. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 31 Jan 2012 Link to this post

    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 >>

Back to Top
UI for WPF is Visual Studio 2017 Ready