In my current project, I needed a the ability to output the current iteration while traversing through data-bound control as well as the report total sum of rows bound to the item using .NET. I needed something comparable to CurrentRow and RecordCount methods built into the Coldfusion query object.
I’m not use why these bits of code had to be buried so deep, but they are pretty critical in generating report styled content.
To output the current iteration of any data-bound control use this bit of code:
<%# Container.ItemIndex +1 %>
To output the total sum of data rows bound to the item, use this line:
<!-- Where myControl is the ID of your data-bound control --> <%# myControl.Items.Count %>











April 6, 2010
Development