473,385 Members | 1,796 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Changing alternate row color on mouseover

Hi All,
I have a gridview in which i set alternate row color property. Now i want
to set color change on mouse over and reset it back on mouse out. The
problem is that when i mouse out it should take the original color back, for
this i need to know on which row mouse is hovering at present.
Does anybody know how to catch the current row index.

Any help would be appreciated.

Regards.
Jun 27 '08 #1
1 1436
You don't need to know the row index. In javascript, you can keep references
to the previous row and the previous row style:

var prevRow;
var savedClass;

function selectRow (row)
{
if(prevRow!=null)
{prevRow.className=savedClass};
savedClass=row.className;
row.className='SelectionGridSelectedItem';
prevRow=row;
}
--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"raoof ahmed khan" <raoof ahmed kh**@discussions.microsoft.comwrote in
message news:B1**********************************@microsof t.com...
Hi All,
I have a gridview in which i set alternate row color property. Now i want
to set color change on mouse over and reset it back on mouse out. The
problem is that when i mouse out it should take the original color back,
for
this i need to know on which row mouse is hovering at present.
Does anybody know how to catch the current row index.

Any help would be appreciated.

Regards.

Jun 27 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Calan | last post by:
I have a form with some picture boxes as buttons. I'm setting the picture property to a gif file for "normal", and to a different gif for the "pressed" state. This works fine. I get into trouble...
4
by: Kenny | last post by:
I have been trying to write a script that will increase the size of and image when you mouse over it, and decrease it to original size, when you mouse out. After a couple of attempts, this is what...
3
by: Geoff Soper | last post by:
I'm trying to dynamically change the cursor of a couple of maps over an image. Basically the image is in an online photo system where there is a rotate mode. In this mode clicking on the left or...
6
by: Carla | last post by:
hi people, I have a little problem that I can't solve with css and i was wondering if you could help me. I have 4 links, I want that when I click/mouseover in the link 1, it turns to a color...
31
by: Greg Scharlemann | last post by:
Given some recent success on a simple form validation (mainly due to the kind folks in this forum), I've tried to tackle something a bit more difficult. I'm pulling data down from a database and...
4
by: Amy | last post by:
I need some help. I have this table with alternate row colors. Class gray and class white. I have javascript that do highlight when mouseover row ... and onclick to select row and highlight it...
6
by: doomsday123 | last post by:
I want to add alternate text like on an html image to a DataGridViewRow. Is it possible?
1
by: econthecape | last post by:
I have two .gif images that I want to automatically alternate instead of only on a mouseover. Here's the coding so far: <CENTER> <A HREF="http://en.wikipedia.org/wiki/Christmas"...
1
by: =?Utf-8?B?Um9iZXJ0IFNtaXRo?= | last post by:
Hi, I have a repeater control with rows in made of of link buttons so that they react to a click as below: <div> <ASP:Repeater id="rptUserList" runat="server"...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.