Create you GridView Column Objects and add them to Gridview's Columns collection. and you can create your own ItemTemplates for columns for your cuustom values just like you want to manipulate HTML here.
GridView gvDynamicArticle = new GridView();
gvDynamicArticle.Width = Unit.Pixel(700);
gvDynamicArticle.BorderWidth = Unit.Pixel(0);
gvDynamicArticle.Caption = "Report View";
gvDynamicArticle.AutoGenerateColumns = false;
gvDynamicArticle.ShowFooter = true;
TemplateField tf = null;
tf = new TemplateField();
tf.HeaderTemplate = new DynamicGridViewTextTemplate("ArticleID", DataControlRowType.Header);
tf.ItemTemplate = new DynamicGridViewTextTemplate("ArticleID", DataControlRowType.DataRow);
tf.FooterTemplate = new DynamicGridViewTextTemplate(DataControlRowType.Footer, ds.Tables[i].Rows.Count);
gvDynamicArticle.Columns.Add(tf);
follow these link for more information:
http://www.codedigest.com/Articles/ASPNET/168_Create_Dynamic_GridView_Control_in_C_ASPNet.aspx
http://www.codeproject.com/KB/aspnet/dynamic_Columns_in_Grid.aspx
http://www.dotnetfunda.com/articles/article1400-how-to-generate-gridview-columns-dynamically-based-on-user-selection.aspx
Add some bounded column and you can access data at rowcreated event and then use server.htmlDeocde( <html encoded field value>) to show in the grid.. in the same way you can save html code on row command with HtmlEncode( <save html field value> ) using this event.
hope this help you..