This is a migrated thread and some comments may be shown as answers.

Changing Grid Row color from client side.

2 Answers 113 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Amit
Top achievements
Rank 2
Amit asked on 16 Sep 2008, 10:58 AM
HI All,
            i want to change my grid's row color from javascript.My requirement is that once user selects any rows,i want to change its color so he can come to know that he has visited this row.

can any one suggest how to do this?

Thanks
Amit Champaneri

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 16 Sep 2008, 11:21 AM
Hi,

Try the javascript below to set the row color  on the RowSelected client event.

Style:
  .RowSelected td
 {
   
background-color: lightblue !important;
  }

Javascript:
  function OnRowSelected(sender, eventArgs)
 {
  
$get(eventArgs.get_id()).className = "RowSelected";
 }

Thanks,
Princy
0
Amit
Top achievements
Rank 2
answered on 16 Sep 2008, 11:46 AM
Hi Princy,
                Thanks for a quick reply,i tried that solution,and its selecting row successfully on row click.
                but what i want is to select row on any button available on that row.so how to generate that OnRowSelected event for button which resolve my probelm?

Thanks
Amit.
Tags
Grid
Asked by
Amit
Top achievements
Rank 2
Answers by
Princy
Top achievements
Rank 2
Amit
Top achievements
Rank 2
Share this question
or