Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Format Datagrid appearance with Javascript

Reply
Thread Tools

Format Datagrid appearance with Javascript

 
 
mkhmer
Guest
Posts: n/a
 
      04-11-2006
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.backgroundCol or='#dcdcdc';this.style.cursor='arrow';")
e.Item.Attributes.Add("onmouseout" ,
"this.style.color='black';this.style.backgroundCol or='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,


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DataGrid Buttons Appearance MrsLeigh ASP .Net Building Controls 1 05-02-2006 03:15 AM
Checkbox value in datagrid does not reflect appearance PaulNaude ASP .Net Datagrid Control 3 11-04-2005 06:39 PM
Moz 1.7- how do you change appearance Gordon Abbot Firefox 2 04-10-2005 05:01 AM
Appearance of Web Form controls in non-IE browsers Alex ASP .Net 4 08-20-2003 08:30 PM
Re: How to change appearance of Drop Down List control? bruce barker ASP .Net 1 08-13-2003 04:45 PM



Advertisments