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

HighLight a row on Button Click

1 Answer 78 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sigma
Top achievements
Rank 1
Sigma asked on 05 Nov 2012, 12:07 PM

Hi,

My RadGrid has a linkButton in the GridTemplateColumn. I would like to highlight a the row when the LinkButton is Clicked. Please provide a answer soon.

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 05 Nov 2012, 12:09 PM
Hi,

Please try the following coed snippet to Highlight a row on button click.

C#:
protected void LinkButton1_Click(object sender, EventArgs e)
{
    LinkButton btn = (LinkButton)sender;
    GridDataItem ditem = (GridDataItem)btn.NamingContainer;
    ditem.CssClass = "color";
}

CSS:
<style>
    .color
    {
        background-color:Red !important;
    }
</style>

Thanks,
Shinu.
Tags
Grid
Asked by
Sigma
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or