Hi team !!
I use the following code to expand a group in my grid:
goalsDataGrid.ExpandGroup(goalsDataGrid.Items.OfType<IGroup>().ElementAt(1));
The groups are of type "Essential" and "Desired". But suppose i haven't added any record of type "Desired", ElementAt(1) refers to a record of type "Desired".
Now, when i have not yet added an item of type "Desired", obviously the above-mentioned single line of code will throw an ArgumentOutOfRangeException. How do i manipulate the code to expand a group only if it is present?
Regards,
Jimit.