This is a migrated thread and some comments may be shown as answers.

Column Group with hyperlink text.

4 Answers 53 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Khizar Khan
Top achievements
Rank 1
Khizar Khan asked on 04 Mar 2011, 04:47 PM
Hi,

I have a column in the grid where we have html formatted text with a hyperlink, when you move this column to header, the header row is also displaying the html tags and href text..

attached is the example.

Regards,
khizar

4 Answers, 1 is accepted

Sort by
0
Richard Slade
Top achievements
Rank 2
answered on 04 Mar 2011, 05:07 PM
Hello,

Is this HTML in your source data? If so, then this will show up as you have demonstrated. If your source data does not contain HTML, and you are formatting your source string with HTML using the CellFormatting event, then the grouped column will not show the HTML.

I hope this helps but let me know if you have any questions
Richard
0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 08 Mar 2011, 07:27 PM
Hello
Did this help? If so please remember to mark as answer.
If you need further assistance, please let me know
Thanks
Richard
0
Accepted
Jack
Telerik team
answered on 10 Mar 2011, 10:04 AM
Hi Khizar,

If I understand correctly, you want to colorize the text inside grid group header row. In order to do this, you have to enable the html formatting when handling the ViewCellFormatting event. In addition, you should change the text formatting, because it should start with an html tag in order to be recognized as rich text. Please consider the code below:
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. Should you have any further questions, do not hesitate to write us back.

Kind regards,
Jack
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Khizar Khan
Top achievements
Rank 1
answered on 10 Mar 2011, 11:50 AM
Thanks a Lot.

it worked.

Regards,
Khizar
Tags
GridView
Asked by
Khizar Khan
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Jack
Telerik team
Khizar Khan
Top achievements
Rank 1
Share this question
or