While Using Two RadGrid in Single page

3 posts, 0 answers
  1. Venkateswarlu
    Venkateswarlu avatar
    13 posts
    Member since:
    Jun 2013

    Posted 29 Oct 2013 Link to this post

    Hi Sir,

          i am having some problem when i am using Two RadGrids with in Single page.

         Problem: (1). When i Click Add New Record Button on RadGrid1 then it is in Insert Mode
                   (2).  Next if Click on Add New Record Button on Second RadGrid2 then Both are in Insert mode.
                 
                   (3). Now i want to Add the Records through RadGrid2 after Clicking Insert Button Now the Problem is Both Grids validations are        firing so  the Record is not able to Add through RadGrid2. how to overcome this problem Please give me the Suggestion.

    Please go-through the Screenshots.

          


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

    Posted 30 Oct 2013 Link to this post

    Hi Venkateswarlu,

    You can make only one of the Insert-form to be open at a time,this way it won't effect with the insertion and Validation.Please try the following code snippet and let me know if any concern.

    C#:
    //ItemCommand of First Radgrid
    protected void RadGrid1_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
    {
        if (e.CommandName == RadGrid.InitInsertCommandName)
        {
            //Close Insertform of Second Radgrid
            RadGrid2.MasterTableView.IsItemInserted = false;
            RadGrid2.Rebind();
        }       
    }
    //ItemCommand of Second Radgrid
    protected void RadGrid2_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
    {
        if (e.CommandName == RadGrid.InitInsertCommandName)
        {
            //Close Insertform of first Radgrid
            RadGrid1.MasterTableView.IsItemInserted = false;
            RadGrid1.Rebind();
        }
    }

    Thanks,
    Princy
  3. Venkateswarlu
    Venkateswarlu avatar
    13 posts
    Member since:
    Jun 2013

    Posted 30 Oct 2013 Link to this post

     
      Hi Sir,
         Thank you very much for u r Response, as u mentioned way you sent Code snippet working properly.

        But we can set Two RadGrids in Insert Mode at time Insertion and Validation also not effect working properly but we need to Maintain
       ValidationSettings-ValidationGroup  Name Differently for both Grids then only possible after i sent request to u later i got this solution.

      once again Thank you very much for u r response.
Back to Top