datagrid and column data

  • Thread starter Thread starter SKG
  • Start date Start date
S

SKG

i have a datagrid which has to display values like <Main> and <SubMain>
But then they appear to be blank. I found when these values are placed in
datagrid cells
<td></td> they do not show. how can i display them.
Thank!!!
 
Those "<" and ">" are being interpreted as HTML tag delimiters. User Server.HtmlEncode to encode the raw text to HTML text.

I'm using a helper function to format the string.

For example(in C#)

codebehind
-------------
protected string GetFormattedString(object pObj)
{
return Server.HtmlEncode(pObj.ToString());
}

aspx
-----
<ASP:TEMPLATECOLUMN HeaderText="XMLForm">
<ITEMTEMPLATE>
<ASP:Label ID="Label1" ToolTip="Hello" Runat="server">
<%# GetFormattedString(DataBinder.Eval(Container.DataItem, "XML")) %>
</ASP:Label>
</ITEMTEMPLATE>
</ASP:TEMPLATECOLUMN>
 
Thanks Suresh.
But i have autogenerate columns turned on in the datagrid. Here is what iam
doing when
retrieving from database iam formatting as ;lt format. Is there any way to
accomplish this
by keeping autogenerate columns turned on
Thanks!!


Suresh said:
Those "<" and ">" are being interpreted as HTML tag delimiters. User
Server.HtmlEncode to encode the raw text to HTML text.
 
Back
Top