This is a migrated thread and some comments may be shown as answers.

changing the mouseover image for button inside nestedviewtemplate

3 Answers 94 Views
Grid
This is a migrated thread and some comments may be shown as answers.
newbie
Top achievements
Rank 1
newbie asked on 06 Feb 2009, 01:05 AM
I am trying to change the image for an imagebutton on mouseover.

i followed this posting:
http://www.telerik.com/community/forums/aspnet-ajax/grid/reference-control-in-nestedviewtemplate.aspx

I was able to add the attributes in the ItemDataBound event with the code below:

protected

void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)

 

{

 

foreach (GridNestedViewItem item1 in RadGrid1.MasterTableView.GetItems(Telerik.Web.UI.GridItemType.NestedView))

 

{

 

ImageButton imgbtn = (ImageButton)item1.FindControl("ImageButton1");

 

imgbtn.Attributes.Add(

"onmouseover", "src='App_Themes/MLightning/Layout/Key_Select2.bmp'");

 

imgbtn.Attributes.Add(

"onmouseout", "src='App_Themes/MLightning/Layout/Key_Select1.bmp'");}

 

}
}

The image changes on mouseover and mouseout respectively.
However the screen tends to jump when i mouseover the button or mouseout.
I don't want the user to see the screen flicker ... please guide.

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 06 Feb 2009, 04:21 AM
Hello,

You can refer to the following links which discuss on various solutions to avoid flickering of images on mouse over.
Stop Background Images Flickering On Hover State
Background image flickers on hover

Hope these links help you out...
- Princy.
0
newbie
Top achievements
Rank 1
answered on 06 Feb 2009, 05:56 PM
Hi Princy.

I tried the solutions given in the links you posted.
Unfortunately they don't seem to be working for me.
Also, my flickering does not occur only the first time, it is there each time I hover over the imagebutton.

0
Princy
Top achievements
Rank 2
answered on 09 Feb 2009, 05:37 AM
Hi,

Could you check  the IE settings at Tools -> Internet Options -> Temporary Internet files -> Settings; it has to be set to Automatically.
In addition, please note that the internal VS2005 development server (Cassini) does not use cache and if you run your application through it you will always have the flicker on your pages.

Thanks,
Princy

Tags
Grid
Asked by
newbie
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
newbie
Top achievements
Rank 1
Share this question
or