How to insert record into radgrid on the fly

5 posts, 0 answers
  1. kia
    kia avatar
    17 posts
    Member since:
    Oct 2010

    Posted 04 Jul 2011 Link to this post

    Hi

    I want to add record on fly by radgrid.

    I have some textbox and two buttons (Insert and Submit) to add information in radgrid.

    My senario is:   
    When user enter her/his info into textbox and click on the insert button, value of textbox must be inserted into radgrid at client side without save them into database. In the final user click on the submit button, then all rows in radgrid save in database.

    I see this and this demo online, but in both of them using webservice and bind grid from database.
    How I can do my senario?

    Thank's

  2. Tsvetoslav
    Admin
    Tsvetoslav avatar
    1823 posts

    Posted 06 Jul 2011 Link to this post

    Hello Kia,

    I am afraid your scenario is not a supported one as RadGrid is a data-bound control and constructs its structure according to the data that's coming from the server or a web service. 

    Regards,
    Tsvetoslav
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  3. UI for WinForms is Visual Studio 2017 Ready
  4. erwin
    erwin avatar
    358 posts
    Member since:
    Dec 2006

    Posted 07 Jul 2011 Link to this post

    IMHO You can always create a client side data source (a DataTable for instance) and bind the Grid to that. There is no requirement for a DataSource to be connected to a Database or WebService Server.

    PS: I'm sorry the question appears to be about the asp.net control.not the windows forms controls
  5. kia
    kia avatar
    17 posts
    Member since:
    Oct 2010

    Posted 09 Jul 2011 Link to this post

    How can I do that?
    Please show me an example or document.
  6. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 11 Jul 2011 Link to this post

    Hi Kia,

    You can see how to create a javascript array and assign it as a data source to our AJAX web grid from this help topic. With similar approach you can increase the number of items in this array based on the end user entry and rebind the grid to reflect the changes.

    Kind regards,
    Sebastian
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Back to Top
UI for WinForms is Visual Studio 2017 Ready