This is a migrated thread and some comments may be shown as answers.

While Using Two RadGrid in Single page

2 Answers 39 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Venkateswarlu
Top achievements
Rank 1
Venkateswarlu asked on 29 Oct 2013, 10:43 AM
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 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 30 Oct 2013, 08:20 AM
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
0
Venkateswarlu
Top achievements
Rank 1
answered on 30 Oct 2013, 08:38 AM
 
  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.
Tags
General Discussions
Asked by
Venkateswarlu
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
Venkateswarlu
Top achievements
Rank 1
Share this question
or