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

Retrieve DetailsTable item count

2 Answers 43 Views
Grid
This is a migrated thread and some comments may be shown as answers.
MFitzpatrick
Top achievements
Rank 1
MFitzpatrick asked on 30 Jul 2010, 05:44 PM
Hi

I am using a RadGrid with a detail table. I need to be able to access the count of the items in the detail table.
RadGridID.MasterTableView.DetailTables(0).Items.Count always returns zero. Is there a way to get the count of the records in the detail table?

Thanks for any help.

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 02 Aug 2010, 05:26 AM
Hello Michael,

You can try the following code snippet to find the count of items in DetailTable of each items in MasterTable.

C#:
foreach (GridDataItem item in RadGrid1.MasterTableView.Items)
  {
   int count = RadGrid1.MasterTableView.Items[item.ItemIndex].ChildItem.NestedTableViews[0].Items.Count;
  }

Also take a look at the following documentation.
Traversing detail tables/items in Telerik RadGrid
 
Thanks,
Princy.
0
MFitzpatrick
Top achievements
Rank 1
answered on 02 Aug 2010, 01:45 PM
Thanks. That works great.

Michael
Tags
Grid
Asked by
MFitzpatrick
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
MFitzpatrick
Top achievements
Rank 1
Share this question
or