Queries on RadGrid

2 posts, 0 answers
  1. veluswamy vijayakumar
    veluswamy vijayakumar avatar
    1 posts
    Member since:
    May 2010

    Posted 19 Jul 2010 Link to this post


    Hi Telerik,

    Have a few queries on the capability  of the RadGrid in the following scenarios

    1. Can we restrict the user to do either Update or Insert. That is when a new row is added for Insert , the user cannot edit another row and vice versa?

    2. Can we add multiple new rows at the same time instead of one by one?

    Regards



  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 20 Jul 2010 Link to this post

    Hello Veluswami,

    For the first scenario, you can either try the following code snippet to cancel one operation when performing other. Or you can refer the following forum link which shows how to hide the insert form when clicking Edit Button and vice versa.
    Reg: Add new Record and Edit record in the RadGrid

    C#:
    protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)
        {
           if (e.CommandName == RadGrid.EditCommandName)
            {
                if (RadGrid1.MasterTableView.IsItemInserted)
                {
                    e.Canceled = true;
                }
            }
           if (e.CommandName == RadGrid.InitInsertCommandName)
           {
               if (RadGrid1.EditItems.Count > 0)
               {
                   e.Canceled = true;
               }
           }
         }

    I am not sure about showing multiple rows for insert at the same time. But you can keep the pop-insert form after insertion by adding the code whcih is shown below.

    C#:
    protected void RadGrid1_ItemInserted(object source, GridInsertedEventArgs e)
       {
           e.KeepInInsertMode = true;
       }

    Hope this helps you,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top