ASPxGridView and Templates
===

How can I create a template in c# for an AXPxGridViewDataTextColumn?

-The problem that I am having is that the string "<%#Eval("dataTableField1")%>" shows up in the GridView instead of the appropriate values. 


Here is an example of my attempt:

        public override void DataBind()
        {
            ...
            GridViewDataTextColumn myCol = new GridViewDataTextColumn();
            myCol.Caption = "col1";
            myCol.FieldName = "dataTableField1";
            myCol.DataItemTemplate = new ColumnDataItemTemplate();
            ...
        }

        public class ColumnDataItemTemplate : ITemplate
        {
            public void InstantiateIn(Control container)
            {
                GridViewDataItemTemplateContainer Container = (container as GridViewDataItemTemplateContainer);
                LiteralControl lit = new LiteralControl("<div id=\"hr\" style=\"height:100%\"><%#Eval(\"dataTableField1\")%></div>");
                Container.Controls.Add(lit);
            }
        }

This has the same effect:

    Literal lit = new Literal(){Text = "<div id=\"hr\" style=\"height:100%\"><%#Eval(\"dataTableField1\")%></div>"};



Here is an example of what I want to do with the row height taken from this [link][1]:


    <dx:GridViewDataTextColumn FieldName="Description" VisibleIndex="3">
        <DataItemTemplate>
            <div id="hr" style="height:100%">
                <%#Eval("Description")%>
            </div>
        </DataItemTemplate>
    </dx:GridViewDataTextColumn>


This [documentation link][2] shows similar examples of using templates in the markup but I want to do it in the code behind.

Here is a [link][3] on creating templates.

Thanks in advance,
 
   Soenhay


  [1]: http://www.devexpress.com/Support/Center/p/Q273639.aspx
  [2]: http://help.devexpress.com/#AspNet/DevExpressWebASPxGridViewGridViewTemplates_DataRowtopic
  [3]: http://msdn.microsoft.com/en-us/library/y0h809ak%28VS.71%29.aspx