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)
{
radGridView1.BeginUpdate();
radGridView1.AutoSizeRows =
true;
radGridView1.EnableFiltering =
true;
radGridView1.AutoScroll =
true;
radGridView1.ShowGroupPanel =
true;
radGridView1.EnableHotTracking =
true;
radGridView1.EnableAlternatingRowColor =
true;
radGridView1.AllowAddNewRow =
false;
radGridView1.AutoGenerateColumns =
false;
radGridView1.BestFitColumns();
radGridView1.AllowAutoSizeColumns =
true;
radGridView1.AutoSizeColumnsMode =
GridViewAutoSizeColumnsMode.Fill;
radGridView1.Controls.Clear();
radGridView1.ReadOnly =
true;
radGridView1.Columns.Add(
new GridViewTextBoxColumn("Name"));
radGridView1.Columns.Add(
new GridViewTextBoxColumn("Address"));
radGridView1.Columns[1].DisableHTMLRendering =
false;
radGridView1.Columns[1].WrapText =
true;
radGridView1.Columns[1].ReadOnly =
true;
radGridView1.Rows.Add(
"Lester","<html>21 Yeoman Way <a href=http://maps.google.co.uk/maps?q=BA140QL>BA140QL</a></html>");
radGridView1.Rows.Add(
"XYX","<html>22 Yeoman Way <a href=http://maps.google.co.uk/maps?q=BA140QL>BA140QL</a></html>");
radGridView1.Rows.Add(
"ABC","<html>23 Yeoman Way <a href=http://maps.google.co.uk/maps?q=BA140QL>BA140QL</a></html>");
radGridView1.Rows.Add(
"QEP","<html>24 Yeoman Way <a href=http://maps.google.co.uk/maps?q=BA140QL>BA140QL</a></html>");
radGridView1.EndUpdate(
true);
}
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
Regards,
Richard

Did this help? If so please remember to mark as answer.
If you need further assistance, please let me know
Thanks
Richard

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
Richard

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.
Thanks,
Lester

Thanks
Richard

My apologies, I should have thought of this earlier, but you can ensure that HTML is shown in the group header. Please see this forum answer for information
I hope that this helps
Richard

This solves my problem completely. Now My groupings shows with the HTML rendering i.e. without <html> text.
Many Thanks,
Lester

All the best
Richard
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:
void
radGridView1_ViewCellFormatting(
object
sender, CellFormattingEventArgs e)
{
GridGroupContentCellElement cell = e.CellElement
as
GridGroupContentCellElement;
if
(cell !=
null
)
{
cell.DisableHTMLRendering =
false
;
}
}
void
radGridView1_GroupSummaryEvaluate(
object
sender, GroupSummaryEvaluationEventArgs e)
{
if
(e.Value.ToString().Contains(
"<html>"
))
{
e.FormatString =
"{1}"
;
e.Value = e.Value.ToString().Insert(6, e.SummaryItem.Name +
": "
);
}
}
I hope this helps.
Kind regards,
Stefan
the Telerik team