Save a New Row as Soon as User has Added It

2 posts, 0 answers
  1. Simon
    Simon avatar
    11 posts
    Member since:
    Aug 2011

    Posted 12 Apr Link to this post

    When a user clicks the "Click Here to Add a New Row" bar, I need to fill some default values and immediately save the row to the database, before the user has done anything else. I'm using the DefaultValuesNeeded event to fill the default values but if I call Update on my dataAdapter from this event, nothing happens, since the new row hasn't really been added to the collection of rows yet. Is there any way I can save the new row to the database at this point?
  2. Dess
    Dess avatar
    1561 posts

    Posted 12 Apr Link to this post

    Hello Simon,

    Thank you for writing.

    In some cases, you may need RadGridView to create a record in the underlying data source after the end-user commits the new row. In other cases, you may want to have a new record created immediately after the end-user starts editing the new row. RadGridView supports both modes. The behavior of RadGridView in this situation is determined by the AddNewBoundRowBeforeEdit property. The following help article is quite useful on this topic:

    As to the updating the database you can have a look at following link and use this event which suits your requirement best:

    I hope this information helps. Should you have further questions I would be glad to help.

    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. DevCraft R3 2016 release webinar banner
Back to Top