Changing Grid Row color from client side.

3 posts, 0 answers
  1. Amit
    Amit avatar
    34 posts
    Member since:
    May 2007

    Posted 16 Sep 2008 Link to this post

    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. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 16 Sep 2008 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Amit
    Amit avatar
    34 posts
    Member since:
    May 2007

    Posted 16 Sep 2008 Link to this post

    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.
Back to Top