Popup picture on web page

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mbewers1
    New Member
    • Feb 2009
    • 68

    Popup picture on web page

    I have the following code:

    Code:
    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);
            }
    }
    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 SelectIndexChan ged and EditCommand events. The ItemDataBound event appears to be the only one which has DataGridItemEve ntArgs as its event argument.

    Many thanks
    Matt
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32661

    #2
    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?

    Comment

    • mbewers1
      New Member
      • Feb 2009
      • 68

      #3
      Thanks

      Thanks NeoPa, my fault for putting it in the wrong place!

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32661

        #4
        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?) ;)

        Comment

        Working...