I'm currently working on a Gridview code snippet:
<SelectedRowStyle CssClass="SelectedRowStyle" />
This changes the color of the selected row to yellow.
However, when I click a button, I want to remove the css class. I attempted to do this in my code:
Gridview1.SelectedRow.CssClass=
Gridview1.SelectedRow.CssClass.Replace("SelectedRowStyle","")
Gridview1.SelectedRowStyle.CssClass=
Gridview1.SelectedRowStyle.CssClass.Replace("SelectedRowStyle","");
Gridview1.SelectedRow.Attributes.Remove("SelectedRowStyle");
Unfortunately, none of these methods seem to be working. Can you spot where I am making a mistake?