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

Binding Data in RowDetailsTemplate

2 Answers 118 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Daryl Smith
Top achievements
Rank 1
Daryl Smith asked on 18 May 2010, 11:51 PM
Currently I am populating a radgridview with Assembly information name="theAsmGrid". The RadGridView has a RowDetailsTemplate that has a RadTabControl with two tabs Scans/Parts.  Within the Scans tab is an additional RadGridView name="theScanGrid" with a  Loaded=RadGridView_Loaded" that fires when I open the details +/-. 

I can retrieve the parent information:

var

 

 

aRow = ((RadGridView)sender).ParentOfType<GridViewRow>();

 

 

 

if (aRow == null) return;

 

 

 

Assembly anAsm = (Assembly)aRow.DataContext;
...

 

GetScanListAsync(anAsm.BarcodeMark);



That information is then used to bring back data.  What I am struggling with is how to bind data to the "theScanGrid" for the expanded detail row.  I am getting the correct data returned.

thanks




2 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 19 May 2010, 04:48 PM
Hi Daryl Smith,

I am sending you a sample project that illustrates how to bind data for a grid inside RowDetailsTemplate.
In case that does not cover you scenario, please give me more details for what exactly you aim to achieve.

 

All the best,
Maya
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Daryl Smith
Top achievements
Rank 1
answered on 19 May 2010, 05:03 PM

Maya,
thanks for the Reply, updating my request with my solution was on my 'todo' this morning.

Added   

 Loaded="RadTabItem_Loaded_Scans"  to RadTabItem  

 

  Determined the child grid and parent row
private void RadTabItem_Loaded_Scans(object sender, RoutedEventArgs e){   
 var aTabItem = (RadTabItem) sender;   
 var aGrid = (RadGridView) aTabItem.Content;   
 var aRow = ((RadTabItem)sender).ParentOfType<GridViewRow>();   
 Assembly anAsm = (Assembly)aRow.DataContext;   
 
 

 

 

 

 

Then passed the aGrid as the e.UserState upon the async call to the database.

Note: the data is a separate data pull when the Tab is 'Loaded'. 
Upon the datapull ...Complete the e.UserState is cast as RadGridView and the ItemSource set.

thanks

Note: Have edited post to remove white space.  WYS is not WYG...

Tags
GridView
Asked by
Daryl Smith
Top achievements
Rank 1
Answers by
Maya
Telerik team
Daryl Smith
Top achievements
Rank 1
Share this question
or