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

[Solved] Child grid data disappears on expanding other nodes

2 Answers 88 Views
Grid
This is a migrated thread and some comments may be shown as answers.
mithila arun
Top achievements
Rank 1
mithila arun asked on 01 Oct 2009, 10:55 AM
Hi,
Im trying to build a hierarchical grid ......
have the following structure

 

<telerik:RadGrid ID="RadGrid2" runat="server" Width="100%" ShowStatusBar="true" AutoGenerateColumns="false"

 

 

Skin="Web20" AllowSorting="false" AllowMultiRowSelection="False" AllowPaging="false"

 

 

OnDetailTableDataBind="RadGrid2_DetailTableDataBind" >

 

 

<MasterTableView Width="100%" DataKeyNames="TypeID " ShowHeader="false" ShowFooter="false">

 

 

<DetailTables>

 

 

<telerik:GridTableView Width="100%" ShowHeader="false" BorderColor="black" BorderWidth="0px" AutoGenerateColumns="false"

 

 

BorderStyle="Solid" DataKeyNames="CoverID" Name="covers">

 

 

<DetailTables>

 

 

<telerik:GridTableView Width="100%" ShowHeader="false" BorderColor="black" BorderWidth="0px" AutoGenerateColumns="false"

 

 

BorderStyle="Solid" DataKeyNames="CoverID,ElementTypeID" Name="coverelementtype">

 

 

<Columns>

 

 

<telerik:GridBoundColumn DataField="TypeName">

 

 

</telerik:GridBoundColumn>

 

 

</Columns>

 

 

</telerik:GridTableView>

 

 

</DetailTables>

 

 

</telerik:GridTableView>

 

 

</DetailTables>

 

 

<ItemStyle CssClass="telerikgriditem" />

 

 

<AlternatingItemStyle CssClass="telerikgriditem" />

 

 

<Columns>

 

 

<telerik:GridBoundColumn DataField="TypeName">

 

 

</telerik:GridBoundColumn>

 

 

</Columns>

 

 

</MasterTableView>

 

 

</telerik:RadGrid>

 


-------------------------------------------------
and dataset is fetched in page load & rad control is bound
& in detailsdatabound the dataset is fetched & datasource of detailsview is set

the problem here is i expand  a node & child grid is visible
now if i expand other node the previously visible child grid data disappears

im not using ajaxmanager

any help??


2 Answers, 1 is accepted

Sort by
0
mithila arun
Top achievements
Rank 1
answered on 01 Oct 2009, 12:29 PM
i dont have the list of columns in desing but im deifning it in the code in detailtablebind evernt for  the child grid
thanks
0
Veli
Telerik team
answered on 06 Oct 2009, 01:46 PM
Hi mithila,

Try using RadGrid's NeedDataSource event for rebinding RadGrid. Here more info:

Advanced data-binding

Your scenario sounds like your are changing your RadGrid structure dynamically on postback. Here is an article on the main requirements you need to observer:

Changing the grid structure dynamically on postback

All the best,
Veli
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Grid
Asked by
mithila arun
Top achievements
Rank 1
Answers by
mithila arun
Top achievements
Rank 1
Veli
Telerik team
Share this question
or