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

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

python 3.x - Mapping specific letters onto a list of words -