Skip to content

Change HTMLEncode In An Autogenerated Gridview

The only way I found to change the HtmlEncode property on a bound column when auto-generating the grid-view.

protected void grFeedHistoryView_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            BoundField field = (BoundField)((DataControlFieldCell)e.Row.Cells[2]).ContainingField;
            field.HtmlEncode = false;
        }

 

Published inC#Coding

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *