473,480 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

MouseOver Event

Is it possible to change the background color of the DataGrid on pointing the
mouse over a certain row?

Nov 19 '05 #1
7 1872
Hi,
Consider some javascript!

"rkbnair" wrote:
Is it possible to change the background color of the DataGrid on pointing the
mouse over a certain row?

Nov 19 '05 #2
You need to setup client side onmouseover and onmouseout events for changing
grid row visual properties or style. To setup the events you need to access
grid rows in either ItemDataBound or PreRender server-side event and set
Attributes["onmouseover"] and Attributes["onmouseout"] to appropriate
javascript statements.

Eliyahu

"rkbnair" <rk*****@discussions.microsoft.com> wrote in message
news:66**********************************@microsof t.com...
Is it possible to change the background color of the DataGrid on pointing the mouse over a certain row?

Nov 19 '05 #3
Where can I see some samples on how to use Attributes please?

"Eliyahu Goldin" wrote:
You need to setup client side onmouseover and onmouseout events for changing
grid row visual properties or style. To setup the events you need to access
grid rows in either ItemDataBound or PreRender server-side event and set
Attributes["onmouseover"] and Attributes["onmouseout"] to appropriate
javascript statements.

Eliyahu

"rkbnair" <rk*****@discussions.microsoft.com> wrote in message
news:66**********************************@microsof t.com...
Is it possible to change the background color of the DataGrid on pointing

the
mouse over a certain row?


Nov 19 '05 #4
I said:

MyDataGrid.Attributes.Add ("mouseover", ?????????????????????);

But, how can I change the color of the current row to blue?
"Eliyahu Goldin" wrote:
You need to setup client side onmouseover and onmouseout events for changing
grid row visual properties or style. To setup the events you need to access
grid rows in either ItemDataBound or PreRender server-side event and set
Attributes["onmouseover"] and Attributes["onmouseout"] to appropriate
javascript statements.

Eliyahu

"rkbnair" <rk*****@discussions.microsoft.com> wrote in message
news:66**********************************@microsof t.com...
Is it possible to change the background color of the DataGrid on pointing

the
mouse over a certain row?


Nov 19 '05 #5
You can prepare css styles and change className property. Or you set
background property directly:
MyDataGrid.Attributes.Add ("mouseover",
"this.style.backgroundColor='blue'");

Eliyahu

"rkbnair" <rk*****@discussions.microsoft.com> wrote in message
news:B0**********************************@microsof t.com...
I said:

MyDataGrid.Attributes.Add ("mouseover", ?????????????????????);

But, how can I change the color of the current row to blue?
"Eliyahu Goldin" wrote:
You need to setup client side onmouseover and onmouseout events for changing grid row visual properties or style. To setup the events you need to access grid rows in either ItemDataBound or PreRender server-side event and set
Attributes["onmouseover"] and Attributes["onmouseout"] to appropriate
javascript statements.

Eliyahu

"rkbnair" <rk*****@discussions.microsoft.com> wrote in message
news:66**********************************@microsof t.com...
Is it possible to change the background color of the DataGrid on
pointing the
mouse over a certain row?


Nov 19 '05 #6
this.style.backgroundColor is invalid.
Also, where should I define this line. (in the page_load?)

"Eliyahu Goldin" wrote:
You can prepare css styles and change className property. Or you set
background property directly:
MyDataGrid.Attributes.Add ("mouseover",
"this.style.backgroundColor='blue'");

Eliyahu

"rkbnair" <rk*****@discussions.microsoft.com> wrote in message
news:B0**********************************@microsof t.com...
I said:

MyDataGrid.Attributes.Add ("mouseover", ?????????????????????);

But, how can I change the color of the current row to blue?
"Eliyahu Goldin" wrote:
You need to setup client side onmouseover and onmouseout events for changing grid row visual properties or style. To setup the events you need to access grid rows in either ItemDataBound or PreRender server-side event and set
Attributes["onmouseover"] and Attributes["onmouseout"] to appropriate
javascript statements.

Eliyahu

"rkbnair" <rk*****@discussions.microsoft.com> wrote in message
news:66**********************************@microsof t.com...
> Is it possible to change the background color of the DataGrid on pointing the
> mouse over a certain row?
>


Nov 19 '05 #7
> this.style.backgroundColor is invalid.
Does the browser produce any error message on this statement?
Anyway, alternatively you can use this.bgColor. But that is deprecated. The
style.backgroundColor is the correct form.
Also, where should I define this line. (in the page_load?) As I said,. either in ItemDataBound or PreRender event.

Eliyahu

"Eliyahu Goldin" wrote:
You can prepare css styles and change className property. Or you set
background property directly:
MyDataGrid.Attributes.Add ("mouseover",
"this.style.backgroundColor='blue'");

Eliyahu

"rkbnair" <rk*****@discussions.microsoft.com> wrote in message
news:B0**********************************@microsof t.com...
I said:

MyDataGrid.Attributes.Add ("mouseover", ?????????????????????);

But, how can I change the color of the current row to blue?
"Eliyahu Goldin" wrote:

> You need to setup client side onmouseover and onmouseout events for

changing
> grid row visual properties or style. To setup the events you need to

access
> grid rows in either ItemDataBound or PreRender server-side event and set > Attributes["onmouseover"] and Attributes["onmouseout"] to appropriate > javascript statements.
>
> Eliyahu
>
> "rkbnair" <rk*****@discussions.microsoft.com> wrote in message
> news:66**********************************@microsof t.com...
> > Is it possible to change the background color of the DataGrid on

pointing
> the
> > mouse over a certain row?
> >
>
>
>


Nov 19 '05 #8

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

Similar topics

3
2278
by: Colin Steadman | last post by:
Help! I'm a stupid HTML bod and I dont do Javascript! I have a grey coloured table that displays certain columns in either red, green or orange to give meaning and emphasis to certain data. ...
2
3327
by: Alex | last post by:
On my page I have a lot string like this: <span onmouseover="callMe(this)" onmouseout="callMe(null)" >abc1</span> <span onmouseover="callMe(this)" onmouseout="callMe(null)" >abc2</span> <span...
2
5144
by: Mitch | last post by:
I am hosting a web browser ctl in a container that implements the IDocHostUIHandler interface. I'm using this to control the context menu.This works fine. Then, I added a mouseover event to the...
2
4471
by: Dariusz Tomon | last post by:
Hi I got task to make my application much more attractive :( First of all I have to add hover (mouseover) effect to several buttons - imagebuttons - I only know manner with Java Script - but it...
1
2636
by: giloosh | last post by:
Hello All, How can you continue the mouseover event while the mouse is still over an object? For example: I put my mouse over a hyperlink and that triggers an object to move 10px to the right....
10
2659
by: jjamjatra | last post by:
I am struggling with a event model handling problem in Javascript that shows up only in Firefox. I have 2 little websites I'd like you to take a look at: ...
1
4338
by: dheepakk | last post by:
Hi All, When a mouseover event takes place over a link the popup window is displayed. I also have a mouseout on the link.So if the popup window comes up,has a dimension such that the...
2
2990
by: markszlazak | last post by:
I'm a relatively slow response of table cells changing their background color with mouseover/our in IE6 (Win 2K) but the response is fine (fast) in Firefox. Why? The code is below. Sorry about the...
2
2263
by: markszlazak | last post by:
Could someone check out the following code and please help me understand the problem and fix it. It seems like some events are not firing when my mouse moves over the table cells to quickly causing...
0
6908
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7048
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7088
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6741
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
6956
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4783
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
4485
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2997
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1300
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.