I'm using an UltraWinGrid to present a list of actions that have been taken. This was originally a webapp, and is being converted to a winforms app, and the actions often have HTML formatting. I've set the column to use FormattedText:
band.Columns["Result"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.FormattedText;
UltraGridBand band = grd.DisplayLayout.Bands[0];
band.Override.CellDisplayStyle = CellDisplayStyle.FormattedText;
grd.UseOsThemes = DefaultableBoolean.False;
grd.DisplayLayout.Override.CellClickAction = CellClickAction.RowSelect;
grd.DisplayLayout.Override.RowSizing = RowSizing.AutoFree;
grd.DisplayLayout.Override.CellMultiLine = DefaultableBoolean.True;
grd.DisplayLayout.ViewStyleBand = ViewStyleBand.Horizontal;
grd.DisplayLayout.Override.SelectTypeCell = SelectType.None;
grd.DisplayLayout.Override.SelectTypeRow = SelectType.Single;
grd.DisplayLayout.Override.AllowAddNew = AllowAddNew.No;
grd.DisplayLayout.Override.AllowDelete = DefaultableBoolean.False;
grd.DisplayLayout.Override.AllowUpdate = DefaultableBoolean.False;
grd.DisplayLayout.Override.ActiveRowAppearance.Reset();
grd.DisplayLayout.Override.ActiveRowCellAppearance.Reset();
As you can see, I've even tried defaulting the whole grid to FormattedText, but without any change in results. To make things just a little more confusing, line breaks are working in the same grid, but with a different item:
The only difference I can see is that this second example only has line breaks, while the first one combines line breaks and bold tags in the same cell. But I don't see why that should matter.I'm using Infragistics 20.2 Win CLR4x.
Hello Lisa,
The FormattedText supports a limited amount of tags and it is not HTML renderer in fact it is based on XML schema that uses the same tags as the HTML to make it easier for the end users who are familiar with HTML.
Below I am posting a webpage from our documentation that describes, which tags are included to the XML schema of the FormattedText:
https://ko.infragistics.com/help/winforms/winformattedlinklabel-formatting-text-and-hyperlinks
To learn more about styling the FormattedText you can refer to the following page:
https://ko.infragistics.com/help/winforms/winformattedtexteditor-style-attribute
I have also created a small sample application, which demonstrates how a column’s style could be set to FormattedText. Please note that since the FormattedText is based on XML if you want to use line break it should have opening and closing tags similar to this - <br></br>
Please test the sample on your side and let me know if you have any questions or concerns.
Regards, Ivan Kitanov
FormattedTextColumn.zip
Hi Ivan,
So it turned out to be a few things. I fixed the line breaks as you suggested. I also removed this line of code:
However, it turns out that there's a bug in the grid. The following is formatted correctly:<a href="[APPROOT]APRelayer.aspx?apitem=411872">
And the following is rendered as plain, unformatted text:
<a href="[APPROOT]APRelayer.aspx?apitem=411872&isrej=1">
In fact, testing shows that even without the link taggage, the string &isrej=1 anywhere in the data prevents that data from being formatted.
I suspect your rendering code sees that and assumes that it is a broken special character, like without the semicolon. That's a problem, because URLs in formatted text do occasionally have query strings with more than one parameter.Because I know that the only second parameter I'm using in this app is isrej, I was able to work around this bug by replacing &isrej with %26isrej (the escape code). But it's still a bug.Thanks,Lisa