I am using Telerik Q3 2010 on Visual Studion 2008 and C# as the Language for development.
As part of our requirement we need to open up a browser on clicking of a postcode within the address (one of the columns) of the GridView.
When I select the address column as a Group by element, the text within the column is shown as it is.
Is there anyway of setting the DisableHTMLRendering of the group Headers to FALSE or any property within the GridView to achieve the same functionality.
Please see sample code below and screen shots attached for more details.
private void Form1_Load(object sender, EventArgs e)
"Lester","<html>21 Yeoman Way <a href=http://maps.google.co.uk/maps?q=BA140QL>BA140QL</a></html>");
"XYX","<html>22 Yeoman Way <a href=http://maps.google.co.uk/maps?q=BA140QL>BA140QL</a></html>");
"ABC","<html>23 Yeoman Way <a href=http://maps.google.co.uk/maps?q=BA140QL>BA140QL</a></html>");
"QEP","<html>24 Yeoman Way <a href=http://maps.google.co.uk/maps?q=BA140QL>BA140QL</a></html>");
10 Answers, 1 is accepted
If you include the HTML in your datasource, then the HTML will show as text in the grouping row. However, if you leave out the HTML formatting and add this to the e.CellElement.Text property using the CellFormatting event, then you can format the required text as HTML and still retain the value (which will be displayed in the grouping row) when you group by that column
For more information on CellFormatting please see this help topic
If you need further information, please let me know
Did this help? If so please remember to mark as answer.
If you need further assistance, please let me know
I have a problem formatting the Cell at runtime, as I need to identify the postcode from the entire address and then provide it a hyperlink.
However, this was easy to identify at the datasource level where the address was being constructed.
Do you have any other options by means of which I can provide a hyperlink to part of the text in a GridViewColumn?
The Telerik controls are built on top of the TPF (Telerik Presentation Foundation) and most support HTML Like formatting. The recognised way is providing HTML for the RadGridView either via the datasource which has the problem that the text and the value will be the same and therefore will show the text value (the HTML) in the grouping row. Using the CellFormatting is the other way.
You might also be interested in this help topic on HTML Like formatting
I hope that this helps but please let me know if you need further information
Thanks a lot for your help so far on this topic. I should appreciate the prompt response.
However with regards to this problem, I have disabled grouping on the Address column as it doesn't seem logical to do so.
This solves my problem completely. Now My groupings shows with the HTML rendering i.e. without <html> text.
All the best
Another approach is to set the DisableHtmlRendering property of the desired column to false by making use of the ViewCellFormatting event. Then in the GroupSummaryEvaluate event you can format the string in order to display corrent HTML:
I hope this helps.
the Telerik team