Custom editable RadGrid

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

    Posted 13 Nov 2011 Link to this post

    I want to have a RadGrid editable with these properties:
    1- Add and remove Row in client side.
    2- Enter value of each column in client side without saving anything in database still user click Save button.
    3- Manage client side keypress such as press Tab button that cause go to next column or next row in RadGrid.

    How can i have it?
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 16 Nov 2011 Link to this post

    Hello Kia,

    Straight to your questions.

    1) Try the following code to Add new record.
    function OnClientClick()
        var grid = $find("<%=RadGrid1.ClientID %>");
        var masterTable = grid.get_masterTableView();
        masterTable.fireCommand("InitInsert", "");
        return false;

    Try the following to Delete a record.
      var currentRowIndex;
      function deleteCurrent()
            var table = $find("<%= RadGrid1.ClientID %>").get_masterTableView().get_element();
            var row = table.rows[currentRowIndex];
            var dataItem = $find(;
            if (dataItem)
      function OnRowSelected(sender, args)
       currentRowIndex = args.get_gridDataItem().get_element().rowIndex;

    2) That is the default behavior of RadGrid,it only saves values after clicking the insert button.

    3) In RadGrid you can easily achieve this by setting AllowKeyboardNavigation property in ClientSettings as true.

Back to Top