In the original markup the designer has that <div class="clear"></div> after every third item in the list. How do I do that (preferably not in the code behind)? Is their a template I can put that in (I think there should be)?

i tried that but did not work 'System.Web.UI.WebControls.ListViewDataItem' does not contain a definition for 'ItemIndex' and no extension method 'ItemIndex' accepting a first argument of type 'System.Web.UI.WebControls.ListViewDataItem' could be found (are you missing a using directive o
–
David BuckleyDec 16 '11 at 16:10

If ItemIndex does not work for you, try with Container.DataItemIndex
–
HoqueDec 16 '11 at 16:16

it not working as should its producing strange results its doing the first one after row three as should but second one after row 2
–
David BuckleyDec 16 '11 at 16:22

@DavidBuckley: (Container.DataItemIndex+1)%3 == 0 should work as the Index starts with 0(zero).
–
HoqueDec 16 '11 at 16:32