Inside a DataList you can do this:
< % # Container.ItemIndex % >Which databinds the current item's index to whatever so it can affect the rendered output
(why else would you do it, d'oh!)
But in GridView you have to do this:
< % # Container.DataItemIndex % >For example, I have a datalist in which I want to have a thick border around only the first item (an image and some text) in order to make it obvious that that is the main image in the gallery
But in a grid view, where i want a label in the first column of only the first row, I use:
< border =" '" itemindex ="="">
< runat="server" id="Label1" text="Main" visible="'" dataitemindex ="=""> '