This is how I have done it (my example has 4 per row).
First you have to add a method to your transformation:
<script runat="server">
public static bool IsCurrentItemLast(Control sender, int count, int index)
{
//get the repeater object
Control myParent = sender;
while (myParent != null)
{
myParent = myParent.Parent;
if (myParent is CMS.Controls.CMSRepeater)
{
CMS.Controls.CMSRepeater myRepeater = myParent as CMS.Controls.CMSRepeater;
var currentPage = myRepeater.PagerControl.CurrentPage;
var pageSize = myRepeater.PagerControl.PageSize;
if( ((currentPage -1) * pageSize + index +1) == count)
{
return true;
}
}
}
return false;
}
</script>
Then you can use this to start a row:
<%# ( (DataItemIndex % 4 == 0) ? "<div class=\"row\">" : "" ) %> <!-- Start Row -->
This to End the row if it's not the Last item
<%# ( ( (DataItemIndex+1) % 4 == 0 && DataItemIndex != 0) ? "</div>" :"" ) %> <!-- End Row -->
And this to end the very last row:
<%# IsCurrentItemLast(this, DataItemCount, DataItemIndex) ? "</div><!--LAST-->" :""%>