Hello,
Here is my problem, I would like to show the elements present visually in the XamGrid and the total of the elements.
I have two questions :
1 - Is there a way to have the number of elements in a group directly ?
2 - I tried a solution but I got a problem :
for that I need to iterate through the rows of the XamGrid but when I try to make a foreach on the Rows property a stackoverflowexception is thrown.
I attached a sample.
Regards.
Hello Petar,
Thanks for your response it works perfectly.
I have been looking into this for you, and it appears to be a timing issue that is caused by iterating with foreach while the Rows collections is being changed. I can suggest putting your RowsCollectionChanged event code into a Dispatcher invoked function to delay its execution like so:
void Rows_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
{
Dispatcher.BeginInvoke(new Action(() =>
if (this.xg.GroupBySettings.GroupByColumns.Count > 0)
this.AfficherNombreElements();
else
this.Elements.Text = this.xg.Rows.Count.ToString();
}));
}
Please let me know, if I can be of any further assistance on the matter.