MouseOver Event

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is it possible to change the background color of the DataGrid on pointing the
mouse over a certain row?
 
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
 
Where can I see some samples on how to use Attributes please?

Eliyahu Goldin said:
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 said:
Is it possible to change the background color of the DataGrid on pointing the
mouse over a certain row?
 
I said:

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

But, how can I change the color of the current row to blue?


Eliyahu Goldin said:
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 said:
Is it possible to change the background color of the DataGrid on pointing the
mouse over a certain row?
 
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 said:
I said:

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

But, how can I change the color of the current row to blue?


Eliyahu Goldin said:
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 said:
Is it possible to change the background color of the DataGrid on
pointing
the
mouse over a certain row?
 
this.style.backgroundColor is invalid.
Also, where should I define this line. (in the page_load?)

Eliyahu Goldin said:
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 said:
I said:

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

But, how can I change the color of the current row to blue?


Eliyahu Goldin said:
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

Is it possible to change the background color of the DataGrid on pointing
the
mouse over a certain row?
 
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 said:
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 said:
I said:

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

But, how can I change the color of the current row to blue?


:

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

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top