G
Guest
On the OnItemDataBound of a datagrid i am trying to check some condition as
shown in the code below:
for(int i = 0; i < ReportDataGrid.Columns.Count; i++)
{
if(ReportDataGrid.Columns.HeaderText=="Brand/Model")
{
intIndex = i;
}
}
Now how do i access the variable 'intIndex' inside the code below:
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType ==
ListItemType.AlternatingItem)
{
e.Item.Cells[intIndex].Text = "Hello";
}
I get build error "Use of unassigend local variable 'inIndex' WHY???
Many thanks in advance
shown in the code below:
for(int i = 0; i < ReportDataGrid.Columns.Count; i++)
{
if(ReportDataGrid.Columns.HeaderText=="Brand/Model")
{
intIndex = i;
}
}
Now how do i access the variable 'intIndex' inside the code below:
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType ==
ListItemType.AlternatingItem)
{
e.Item.Cells[intIndex].Text = "Hello";
}
I get build error "Use of unassigend local variable 'inIndex' WHY???
Many thanks in advance