Update/Insert/Delete through queries at database level

11 posts, 0 answers
  1. Telerik Admin
    Telerik Admin avatar
    1572 posts
    Member since:
    Oct 2004

    Posted 21 Nov 2006 Link to this post


    RadGrid for ASP .NET version

    RadControls for ASP .NET AJAX version

    4.0.3 and later

    2008.1.415 and later

    .NET version

    1.x, 2.0 (RadGrid for ASP .NET version)

    2.0 and later (RadControls for ASP .NET AJAX version)

    Visual Studio version

    2002/2003 and later

    Programming language


    Browser support

    all supported by RadGrid for ASP .NET

    all browsers supported by RadControls for ASP .NET AJAX

    Note: This functionality is supported for RadControls for ASP .NET AJAX version 2008.1.415 and later as described in this hep article.
    This demo application shows how to perform real update/insert/delete (refreshing the data in the database used for grid source). The data editing operations are performed through Update/Insert/Delete commands build inside the UpdateCommand/InsertCommand/DeleteCommand handlers of the grid.
    Note that the primary field referenced on update operation is stored in the DataKeyNames array of the master table and retrieved through DataKeyValues.
    Additionally, this primary field values are auto-incremented (contained in unique column in the source table) on insert operation, thus avoiding the creation of duplicate identity fields (which can happen when you allow the user to enter primary key value on insert).
  2. Sara_lio
    Sara_lio avatar
    27 posts
    Member since:
    Dec 2006

    Posted 17 Jan 2007 Link to this post

    is this code available in C# code?

    Please can anyone help me.

  3. Sebastian
    Sebastian avatar
    9934 posts

    Posted 17 Jan 2007 Link to this post

    Hi Sara,

    There are several free online convertors which can help you transform the logic into C# code. Below is a link to one of them:


    the telerik team
  4. jefflandry
    jefflandry avatar
    30 posts
    Member since:
    Feb 2007

    Posted 06 Feb 2007 Link to this post

    is there a 2.x version of this example?
  5. jefflandry
    jefflandry avatar
    30 posts
    Member since:
    Feb 2007

    Posted 06 Feb 2007 Link to this post

    this example
    is exactly the kind of thing I am interested in understanding.  Where is it?

  6. Vlad
    Vlad avatar
    11100 posts

    Posted 07 Feb 2007 Link to this post

    Hi jeff,

    You can use our code-viewer (just below the grid) to review the code of this example for desired language.

    All the best,
    the telerik team
  7. jefflandry
    jefflandry avatar
    30 posts
    Member since:
    Feb 2007

    Posted 07 Feb 2007 Link to this post

    I did use the code and aspx viewer.  What I got wasn't enough to run correctly so it is a bit hard to figure out.  Fortunately finally got one of the other examples to run and it has some of what I was looking for.

    Jeff Landry
  8. David S
    David S avatar
    26 posts
    Member since:
    Jan 2007

    Posted 08 Feb 2007 Link to this post

    Is this example available as 2.x version in c#?

  9. Yavor
    Yavor avatar
    11 posts

    Posted 09 Feb 2007 Link to this post

    Hello David,

    The file is not available in .net2.0, but it can be easily converted. Additionally, you can use the same logic, in a new .net2.0 project, since the approach is similar.

    Sincerely yours,
    the telerik team
  10. Sharon
    Sharon avatar
    2 posts
    Member since:
    Aug 2011

    Posted 05 Sep 2011 Link to this post


             Can I use this sample http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/alleditablecolumns/defaultcs.aspx for doing the update/insert/delete as i'm using RadGrid1.MasterTableView.AutoGeneratedColumns. Meaning i have no pre-defined GridBoundColumn in my aspx code. 
        Meanwhile, is there a way to change the individual row edit button to a 'edit all' button. Meaning one click of button, all the row will become editable. is there any sample code be available?

        pls advise.
  11. Nikita Gourme
    Nikita Gourme avatar
    318 posts
    Member since:
    May 2006

    Posted 06 Sep 2011 Link to this post

    Sharon, the same code should work with auto-generated columns, too, as long as you specify the corresponding data source parameters for update/insert/delete operations.

    The quickest means to implement Edit All functionality I can think of is to add a GridButtonColumn to the grid with ButtonType="ImageButton" and CommandName="EditAll" (also make sure you set AllowMultiRowEdit = true for the grid). A list of all commands that are recognized internally by the Telerik grid is available here.

Back to Top

This Code Library is part of the product documentation and subject to the respective product license agreement.