Format Datagrid appearance with Javascript

M

mkhmer

Does anybody know how can I format the appearance of DataGrid at clientside
script (javascript)?
I try to add the color change to all item whenever mouse is moved on or out
of that item, moreover I want to show different color when an item is
selected (clicked) and when other one is click the old selected one must
clear it color to look same as other unseleted item.

Here is my code:
============
Sub Custom_Bound(sender As Object, e As DataGridItemEventArgs)
if e.Item.ItemType = ListItemType.Item or e.Item.ItemType
=ListItemType.AlternatingItem then
e.Item.Attributes.Add("onclick",
"this.style.backgroundColor='black;")
e.Item.Attributes.Add("onmouseover" ,
"this.style.color='black';this.style.backgroundColor='#dcdcdc';this.style.cursor='arrow';")
e.Item.Attributes.Add("onmouseout" ,
"this.style.color='black';this.style.backgroundColor='white';")
End If
End Sub
============

Please help at the line to add "OnClick" event, how can I handle the
proccess that clear other unselected item before set the current selected
item into "Black" backgroud color?

Thanks,
 

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

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top