Skip to content

Infragistics Community Forum / Web / Ultimate UI for ASP.NET Web Forms / WebDataGrid HtmlEncode False Still Shows HTML Tags

WebDataGrid HtmlEncode False Still Shows HTML Tags

New Discussion
bjarni
bjarni asked on Jun 6, 2012 8:03 AM

Infragistics version in use: 11.2.20112.2086

Through my searching of both this form and the net at large I have been lead to believe that setting the HTMLEncode property of a column to false should render html tags when they are shown within a WebDataGrid such that:

<b>Hello</b> World

would become

Hello World

However the tags just refuse to go away in my application regardless of what I set the column’s property to.

 

Here is my set up:

We have a grid which is bound to a dataset. In the page_load function we dynamicly create all the nessisary columns for the grid based on the dataset table it is bound to.

foreach (DataColumn c in this.myDataSet.myDataTable.Columns) {

if (!c.ColumnName.StartsWith(“id_”)) { // filter out all id columns so they are not shown

BoundDataField newColumn = new Infragistics.Web.UI.GridControls.BoundDataField();

newColumn.DataFieldName = c.ColumnName;

newColumn.Header.Text = c.Caption;

newColumn.Key = c.ColumnName;

newColumn.HtmlEncode = false;

this.StikiWebGrid.DataGrid.Columns.Add(newColumn);

}

}

As you can see I have told it to sent all the columns HTMLEncode properties to false which should display the text as bold rather then showing the tags, however when I run the application I still see this.


 

Thinking that maybe setting the property within the pageload as I am doing was the culprit of the issue I have also attempted to manually add just the description field to the markup and set the property there instead. The result was the same, the tags still showed up instead of the bolded text.

<ig:WebDataGrid ID=”WebDataGrid” runat=”server” AutoGenerateColumns=”False”>

<Columns>

<ig:BoundDataField DataFieldName=”Description” Key=”Description” HtmlEncode=”false”>

<Header Text=”Help” />

</ig:BoundDataField>

</Columns>

<Behaviors></Behaviors>

</ig:WebDataGrid>

 

I am at a lost as to what I am doing incorrectly. Have I forgotten some other property somewhere on the grid perhaps? Any assistance would be greatly appreciated.

Sign In to post a reply

Replies

  • 0
    [Infragistics] Petar Ivanov
    [Infragistics] Petar Ivanov answered on May 31, 2012 9:08 AM

    Hi stikibjarni,

    Thank you for posting in the community.

    The approach which you are using seems sound and I am so far unable to replicate the issue you are experiencing. Attached is my test sample which uses 11.2.20112.2086.

    Please let me know if you can reproduce the issue with this sample and whether there are any other specifics to your scenario, such as the grid being nested in other controls.

    Do not hesitate to contact me with any updates and additional questions.

    • 0
      [Infragistics] Petar Ivanov
      [Infragistics] Petar Ivanov answered on Jun 6, 2012 8:03 AM

      Hello stikibjarni,

      Please feel free to contact me if you are still experiencing any issues with this scenario.

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
bjarni
Favorites
0
Replies
2
Created On
Jun 06, 2012
Last Post
13 years, 8 months ago

Suggested Discussions

Created by

Created on

Jun 6, 2012 8:03 AM

Last activity on

Feb 12, 2026 9:55 AM