I have list to bind and inside of list there is another list. In inner list I want to format only 5 repetition after 5 they will go to the next row. And I have a code for that in Row Groups
=Fields.RowNum/5
above code snippet works fine if there is ony one list. But within nested list it shows error
The error has been occurred while processing Table "list2" The expression contains object "RowNum" that is not defined in the current context
cause of error is:
I am providing a list for 1st list and there is another list inside that list. So, it's not readable while binding the report.
DataTable dt = dal.ReturnSQLDataTable(sql);
List<Area> lstItems = new List<Area>();
if (dt != null && dt.Rows.Count > 0)
{
lstItems = (from DataRow dr in dt.Rows
select new Area()
{
area_id = Convert.ToString(dr["area_id"]),
area_name = Convert.ToString(dr["area_name"]),
Rooms = GetAreaItem(Convert.ToString(dr["area_id"]),item_id)
}).ToList();
}
this.list1.DataSource = lstItems;
So, how will I bind or read that RowNum form list dynamically to bind exact nested data with below expression
=Fields.RowNum/5
I have modified it as and try to read it's 1st index like below code snippet
=Fields.Rooms[0].RowNum/5
but still got error
An error has been occurred while processing Table "list2":Missing operator before "[0]" operand
if anyone have any idea to modify the expression please help.
Thanks
What I have tried:
=Fields.RowNum/5
=Fields.Rooms[0].RowNum/5