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,
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,