"RSB" <rs*****@hotmail.com> wrote in message
news:7H*****************@news.cpqcorp.net...
Hi I Want to Bind the DataGrid with the Collection i have and want to
display a RowCounter 1,2,3,4,... in the First Column.. how to Do this??
Does Datagrid Provides any property etc.etc.??
The ItemDataBound event of the DataGrid will be raised once per row in the
grid. You can use the EventArgs to get access to the Item being bound, and
therefore, to the ItemIndex:
private void myGrid_ItemDataBound(object sender, DataGridItemEventArgs e)
{
// e.Item.ItemIndex is the index of the item being DataBound
}
You could add a TemplateColumn as your first column, and it could contain a
Label control. You could set the text of the label to ItemIndex.
--
John Saunders
johnwsaundersiii at hotmail