Expand|Select|Wrap|Line Numbers
- protected void contactsGrid_ItemDataBound(object sender, DataGridItemEventArgs e)
- {
- if (e.Item.ItemType == ListItemType.SelectedItem)
- {
- e.Item.Attributes.Add("onmouseover", "this.style.backgroundColor='LightBlue'");
- e.Item.Attributes.Add("onmouseout", "this.style.backgroundColor='#EFF3FB'");
- LoadStaffImage(e.Item.Cells[6].Text);
- }
- }
LoadStaffImage(e.Item.Cells[6].Text);
line seems to load repeatedly for each row in the grid but it is not called again when the user hovers over the row. Why does this happen and can you point me in the right direction of what event I should use to do this task if the _ItemDataBound event is not the correct one?
I've also tried impleenting this in the SelectIndexChanged and EditCommand events. The ItemDataBound event appears to be the only one which has DataGridItemEventArgs as its event argument.
Many thanks
Matt