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

[Solved] highlight row on link button click of the row

1 Answer 74 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Allen
Top achievements
Rank 1
Allen asked on 25 Apr 2013, 11:40 AM
Hi
     How can I highlight a row on link button click of that row?? Please share some ideas..
thanks in advance
Allen

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 25 Apr 2013, 11:45 AM
Hi,

Please try the following code snippet to highlight a row on button click

C#:
protected void button1_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,
Princy.
Tags
Grid
Asked by
Allen
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or