4 Answers, 1 is accepted
0
Hello Dennis,
Thank you for your interest in our controls.
Please find below a sample function which illustrates how you can complete the task:
I suggest you call this method after the grid is bound.
Example
Hope this helps.
Regards,
Rosi
the Telerik team
Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Thank you for your interest in our controls.
Please find below a sample function which illustrates how you can complete the task:
private void IterateRows(IList<Record> records) |
{ |
foreach (Record record in records) |
{ |
if (record is ExpandableDataRecord) //iterates inside hierachy rows |
{ |
ExpandableDataRecord expandableRecord = (ExpandableDataRecord)record; |
IterateRows(expandableRecord.ChildRecordManagers[0].Records); |
} |
if (record is GroupRecord) //iterates inside group rows |
{ |
GroupRecord groupRecord = (GroupRecord)record; |
IterateRows(groupRecord.Records); |
} |
rows++; |
} |
} |
I suggest you call this method after the grid is bound.
Example
public partial class Example |
{ |
public int rows = 0; |
public Example() |
{ |
InitializeComponent(); |
radGridViewAggregates.ItemsSource = ExamplesDB.GetCustomers(); |
radGridViewAggregates.Loaded += new System.Windows.RoutedEventHandler(radGridViewAggregates_Loaded); |
} |
void radGridViewAggregates_Loaded(object sender, System.Windows.RoutedEventArgs e) |
{ |
IterateRows(radGridViewAggregates.Records); |
} |
} |
Hope this helps.
Regards,
Rosi
the Telerik team
Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
christine
Top achievements
Rank 1
answered on 29 Sep 2011, 07:20 PM
Is there a more current example for doing this or is using the 'Records' property still the correct way?
0
Hello Christine,
Vlad
the Telerik team
You can use RadGridView Items collection to iterate data items.
Kind regards,Vlad
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
christine
Top achievements
Rank 1
answered on 03 Oct 2011, 09:49 PM
Maybe I should clarify on what I am really trying to do, I will start a new thread.