By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,611 Members | 1,699 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,611 IT Pros & Developers. It's quick & easy.

Popup picture on web page

P: 68
I have the following code:

Expand|Select|Wrap|Line Numbers
  1. protected void contactsGrid_ItemDataBound(object sender, DataGridItemEventArgs e)
  2.     {
  3. if (e.Item.ItemType == ListItemType.SelectedItem)
  4.         {
  5.             e.Item.Attributes.Add("onmouseover", "this.style.backgroundColor='LightBlue'");
  6.             e.Item.Attributes.Add("onmouseout", "this.style.backgroundColor='#EFF3FB'");
  7.             LoadStaffImage(e.Item.Cells[6].Text);
  8.         }
  9. }
  10.  
I would like to be able to load a picture, based on ther row the user has currently hovered their mouse over in the DataGrid. When I tried debugging it, the:

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
May 18 '09 #1
Share this Question
Share on Google+
3 Replies


NeoPa
Expert Mod 15k+
P: 31,712
As this code looks more like c than VBA, I'm wondering if Access is the best place for this. You're welcome to leave it here if you feel it is, but I can't see too many Access experts giving this more than a quick glance I'm afraid Matt.

That's not to say you won't get lucky. I'm just wondering if another forum may not be more help to you?
May 18 '09 #2

P: 68
Thanks NeoPa, my fault for putting it in the wrong place!
May 19 '09 #3

NeoPa
Expert Mod 15k+
P: 31,712
I will happily move it for you if you tell me where the right place is (which language is it? Simple c? One of the other flavours?) ;)
May 19 '09 #4

Post your reply

Sign in to post your reply or Sign up for a free account.