Cannot add to RadGridView

2 posts, 0 answers
  1. Mohammed
    Mohammed avatar
    9 posts
    Member since:
    Jul 2014

    Posted 22 Feb 2015 Link to this post

    Hello Guys ,

    I am newbie with tererik RadGridview with winforms and I build form that have collection of custom object called SaleBillDetailsDTO the grid showed values correctly but when I add new item in grid the data disappear

    BindingSource bsData = new BindingSource();
    var listBinding = new BindingList<SaleBillDetailsDTO>(lstSBDetails);
    bsData.DataSource = listBinding;
    radGridView2.DataSource = bsData; 
     
    // Allow the user to add rows
    ((BindingList<SaleBillDetailsDTO>)bsData.List).AllowNew = true;
    ((BindingList<SaleBillDetailsDTO>)bsData.List).AllowRemove =
    true;  

    What should I do to add new row ? If you have sample tutorial it will be very helpful
  2. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 23 Feb 2015 Link to this post

    Hello Mohammed,

    Thank you for writing.

    I would suggest that you go through this article which explains how to bind to a collection of custom objects: 
    Reflecting Custom Object Changes in RGV | UI for WinForms Documentation.

    I hope that you find this information useful. Should you have any other questions, do not hesitate to contact us.

    Regards,
    Stefan
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top