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

Highlight cell text

8 Answers 284 Views
GridView
This is a migrated thread and some comments may be shown as answers.
tyler thompson
Top achievements
Rank 1
tyler thompson asked on 16 Oct 2008, 04:17 PM
Hello,

Is it possible to change the BackColor of a set of characters in a cell in order to highlight search results?  I know I can change the background of the cell but I would like to highlight the text as Outlook does when you are searching for an email.  Thank you for your help.

Tyler

8 Answers, 1 is accepted

Sort by
0
Nick
Telerik team
answered on 17 Oct 2008, 06:25 PM
Hello tyler thompson,

I am happy to share with you that there will be something quite similar in the next release. You will be able to set different colors to letters in a string (foreground color). Unfortunately we will not provide different background colors for letters.
 
Do not hesitate to write me back if you need further assistance.

Best wishes,
Nick
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Damien
Top achievements
Rank 1
answered on 18 Jun 2009, 01:04 PM
Hi Nick,

Just wondering if this functionality has been made available in the latest relase - and if so, can i have a heads up on how to implement.

Cheers
0
Nick
Telerik team
answered on 22 Jun 2009, 07:17 AM
Hello Damien,

Please follow this help article and also set DisableHtmlRendering property to false for all grid columns that you would like to render Telerik html like formatting tags instead of showing them as text.

All the best,
Nick
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Damien
Top achievements
Rank 1
answered on 22 Jun 2009, 10:37 PM
Thanks Nick,

This works well for a control where I am setting the text property directly i.e. labels, buttons... - I'm still a little confused as to how to implement this type of formatting in a radgrid where the grid is using bound data?

To elaborate, I have a radgrid that is displaying the results from a search performed based on user entered keywords. I want to be able to highlight these words in a single column of my grid. SImilar to how a web search engine would behave when it displays results.

I tried another idea: I can achieve the behaviour I need using a RichTextBox and it's Find method, however it doesn't look like I can insert the RTB control into a cell in the grid to perform the display - the grid is still the best way to display the result set, but the highlighting of the keywords is a mandatory function.

Any other input most welcome.

Cheers,
Damien
0
Nick
Telerik team
answered on 23 Jun 2009, 08:53 AM
Hi Damien,

The cell values must contain the tags as well so you probably have to use unbound mode and set cell values dynamically. You will need to write some code that inserts appropriate tags in the appropriate places of your strings.

Please tell us more about the reason that you have to use bound mode?

Greetings,
Nick
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Damien
Top achievements
Rank 1
answered on 23 Jun 2009, 10:46 AM
Thanks Nick - yes... unbound mode will do the trick - i should have thought that through a bit more :)

Cheers,
Damien
0
Monika
Top achievements
Rank 1
answered on 21 Jun 2012, 04:05 AM
Hi Nick,

I have a radgrid in which there is a Date column(Bound Field) and based on certain condition I have to highlight that Date as yellow.
In ItemDataBound I tried item["Due Date"].Style.Add("background-color", "Yellow"); and also

item["Due Date"].BackColor = System.Drawing.Color.Yellow;

 

but it is setting the complete column background as yellow not just highlighting the Date.

Please suggest How to highlight only the text in column.
0
Ivan Petrov
Telerik team
answered on 25 Jun 2012, 11:20 AM
Hi Monika,

Thank you for writing.

You may use the ConditionalFormatting feature of RadGridView. You can find more on it in our online product documentation - ConditionalFormatting. If this is not what you are looking for, I would kindly ask you to send a more detailed explanation of your case, a screenshot or a sketch would also be helpful.

I am looking forward to you reply.

Greetings,
Ivan Petrov
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
Tags
GridView
Asked by
tyler thompson
Top achievements
Rank 1
Answers by
Nick
Telerik team
Damien
Top achievements
Rank 1
Monika
Top achievements
Rank 1
Ivan Petrov
Telerik team
Share this question
or