Add new row disappears

14 posts, 0 answers
  1. Lovsten
    Lovsten avatar
    72 posts
    Member since:
    Aug 2007

    Posted 29 Aug 2007 Link to this post

    Just purchased RadControls for Winforms and is starting to use it.

    I have a problem with the addnewrow functionality.

    Im connected the GridView to a collection of one of my business objects.
    It loads just fine. I can edit a value just fine.
    I got Allownewrow=true so the "Click here to add new row" shows.
    When I enter values here and then change row I can debug that the new object is inserted into my collection, but it does not show any more in GridView. If I do an Update, which saves my collection to DB the object is there and gets saved. If I reload the collection the new row is there.

    But I want the user to see new rows added without having to save it. What am I doing wrong?
  2. Dwight
    Admin
    Dwight avatar
    475 posts

    Posted 29 Aug 2007 Link to this post

    Hi Lovsten,

    The problem you experience is that the data source does not notify the grid of the changes. Here is how it works:
    1. The grid adds the new record in the data source.
    2. The data source notifies the grid for the changes that have occurred
    3. The grid refreshes with the new changes applied
    To be able to use that, your data source needs to implement the IBindingList interface. This way every change in the data source (no matter if it is made by the grid or by external source) will be reflected in the grid.

    Instead of implementing all methods of the IBindingList interface, you can inherit the BindingList class that has default implementation of the above mentioned interface.
     

    Regards,
    Evtim
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Lovsten
    Lovsten avatar
    72 posts
    Member since:
    Aug 2007

    Posted 30 Aug 2007 Link to this post

    Hi

    My collection (Suppliers) does implement the IBindingList interface.
    Any other ideas?

    Our class structure looks like this:

    Public Class Suppliers

    Inherits BusinessCollectionBase

    ***

    Public MustInherit Class BusinessCollectionBase

    Inherits SortableCollectionBase

    ***

    Public Class SortableCollectionBase

    Inherits BindableCollectionBase

    ****

    public abstract class BindableCollectionBase : CollectionBase, IBindingList


     

  5. Dwight
    Admin
    Dwight avatar
    475 posts

    Posted 30 Aug 2007 Link to this post

    Hello Magnus,

    We found an issue in the data layer which causes the problem you experience. In our upcoming release in the middle of September, it will be fixed.

    As a workaround you can set the grid's datasource to null, then set your datasource again.

     
    Greetings,
    Evtim
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  6. Lovsten
    Lovsten avatar
    72 posts
    Member since:
    Aug 2007

    Posted 31 Aug 2007 Link to this post

    In which event do you recommend me doing this reset of datasource?
  7. Lovsten
    Lovsten avatar
    72 posts
    Member since:
    Aug 2007

    Posted 04 Sep 2007 Link to this post

    I have not got a response on the last question.

    And also, when I try to reinit the datasource as you say, it seems like the values I enter disappear and the new row get the values for the last row before I added a row = I end up with to rows with the same values. What am I doing wrong?
  8. Dwight
    Admin
    Dwight avatar
    475 posts

    Posted 04 Sep 2007 Link to this post

    Hello Magnus,

    We are sorry for the delayed answer.

    Our research shows that the changes (the newly added data) are not pushed back to the BindingList data source. This is an issue we have to fix.

    Again, we apologize for the inconvenience and the delays this issue is causing.
     

    Kind regards,
    Evtim
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  9. Lovsten
    Lovsten avatar
    72 posts
    Member since:
    Aug 2007

    Posted 04 Sep 2007 Link to this post

    Fair enough. I wait eagerly on the new release then.

    But I need to get something working in the meantime. I was thinking of just removing your add new row (AllowAddNew=false) and handle this myself from a contextmenu.

    Tried 2 things (and none worked)
    1. .rows.add(values)
    2. Mycollection.Add(new MyObject)

    How should I do this?? I need a temp workaround
  10. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 04 Sep 2007 Link to this post

    Hello Lovsten,

    The Q2 beta will be published tomorrow and it will contain fixes for your issue. For now we can offer you to manually update the grid data. This can be done using MasterGridViewInfo.UpdateView function. Use this code:

    this.radGridView1.MasterGridView.UpdateView(false);

    Best wishes,
    Jack
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  11. Lovsten
    Lovsten avatar
    72 posts
    Member since:
    Aug 2007

    Posted 05 Sep 2007 Link to this post

    Could not get that to work either so I just wait for the beta. Where can I download it from when it's been published?
  12. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 06 Sep 2007 Link to this post

    Hello Lovsten,

    It is our pleasure to announce the long awaited beta of RadControls for WinForms Q2 2007. Here is a link to the official announcement: http://www.telerik.com/community/forums/thread/b311D-htmdd.aspx

    In case you need the Dev version of the beta, please open a support ticket and we will send you the link.


    Greetings,
    Jack
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  13. Lovsten
    Lovsten avatar
    72 posts
    Member since:
    Aug 2007

    Posted 06 Sep 2007 Link to this post

    I'm now using the Q2 beta. These are my results:

    First time I click on add new row adn enters new values, the row still disappears.
    Second time I do this, it work just fine.
    Third and onwards, adds a new row but it's always added with the values from the second time.
  14. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 06 Sep 2007 Link to this post

    Now, this is strange. As much as I hate to say this, I am not sure where the problem is. I discussed your case with the rest of the RadGridView developers and they have no clues where the problem could be either. The only way to find what is wrong is to review your application.

    WIll it be possible to open a support ticket and send us a sample application with your business objects? This way we will be able to investigate the issue. Thank you for your cooperation.
     

    Regards,
    Jack
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  15. Lovsten
    Lovsten avatar
    72 posts
    Member since:
    Aug 2007

    Posted 06 Sep 2007 Link to this post

    Support ticket now opened
Back to Top
UI for WinForms is Visual Studio 2017 Ready