WebDataGrid HtmlEncode False Still Shows HTML Tags
New DiscussionInfragistics 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.