c# - Css class not getting removed in code behind -


i have following code gridview:

<selectedrowstyle cssclass="selectedrowstyle" /> 

where change selected row yellow color.

and on button click want remove css class. tried handle in code following:

gridview1.selectedrow.cssclass= gridview1.selectedrow.cssclass.replace("selectedrowstyle","")  gridview1.selectedrowstyle.cssclass= gridview1.selectedrowstyle.cssclass.replace("selectedrowstyle","");  gridview1.selectedrow.attributes.remove("selectedrowstyle"); 

but nothing works. going wrong ?

simply assign empty string cssclass proeprty , remember need rebind grid view change

gridview1.selectedrow.cssclass = ""; 

Comments

Popular posts from this blog

Why can rails not find a route created by a helper? -

javascript - jquery or ashx not working -

php - Redirect and hide target URL -