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

hierarchical grid (Ajax enabled)

4 Answers 59 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rajiv
Top achievements
Rank 1
Rajiv asked on 27 Sep 2008, 03:33 PM
Hi,
Inside my master table there are 4 detail tables(all at same level), and all of them have the add/edit function enabled. What I want to achieve is that the user should be able to add new row only in one table at a time. i.e. if the user clicks on add record for the 1st table and then also clicks on the add record for the second table then the new row for the 1st table should disappear(add record for 1st table should be cancelled).

Please help.

Best Regards,
Rajiv

4 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 29 Sep 2008, 04:55 AM
Hi Rajiv,

Try setting the Name property for the Master and detail tables and try the following code snippet in the ItemDatabound event.

CS:
  protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) 
    { 
        if ((e.Item.OwnerTableView.Name == "Master")&&(e.Item.OwnerTableView.IsItemInserted)) 
        { 
            RadGrid1.MasterTableView.DetailTables[0].IsItemInserted = false
        } 
        else if( (e.Item.OwnerTableView.Name == "Detail1")&&(e.Item.OwnerTableView.IsItemInserted)) 
        { 
            RadGrid1.MasterTableView.IsItemInserted = false
             
        } 
       
    } 


Thanks
Shinu.
0
Rajiv
Top achievements
Rank 1
answered on 29 Sep 2008, 06:02 AM
Thank you for your reply, Shinu.
The solution didn't seems to work for me. Could it be possible that since the grid is ajax enabled the other tables are not getting refreshed even after the IsItemInserted property is set to false?

Please help.

Thanks & Regards,
Rajiv
0
Rajiv
Top achievements
Rank 1
answered on 30 Sep 2008, 10:58 AM
Hi all,
I am still struggling to find the fix for the issue mentioned below. Any help on this is highly appriciated.

Thanks & Regards,
Rajiv

0
Iana Tsolova
Telerik team
answered on 30 Sep 2008, 11:09 AM
Hi Rajiv,

Please review the following help topics on how to switch the insert/update/regular modes of RadGrid and find more about RadGrid hierarchy:

http://www.telerik.com/help/aspnet-ajax/grdswitchinginsertaddmodes.html
http://www.telerik.com/help/aspnet-ajax/grddistinguisheditinsertmodeonitemcreateditemdatabound.html
http://www.telerik.com/help/aspnet-ajax/grdseveraltablesatlevel.html

Check it out and let us know if you need further assistance.
 
Regards,
Iana
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Rajiv
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Rajiv
Top achievements
Rank 1
Iana Tsolova
Telerik team
Share this question
or