AUTHOR: Richard Hellwege
DATE POSTED: June 19, 2018
RadPageLayout throws IndexOutOfBounds exception when iterating over LayoutRowCollection.
When I try to use a For Each loop to iterate over the LayoutRowCollection, I receive an IndexOutOfBounds error.
The RadPageLayout component does not fully implement the GetEnumerator() method from the IEnumerable interface. As an result, an iterator can not be built automatically which leads to issues while using a For Each loop.
To work around this issue - a traditional For loop can be used.The code below demonstrates how to loop over all rows and columns of a RadPageLayout to do work or locate information.
for
(
int
row = 0; row <= RadpageLayout1.Rows.Count - 1; row++)
{
col = 0; col <= RadpageLayout1.Rows.Item(row).Columns.Count - 1; col++)
// Do Work
}
Resources Buy Try