Highlight cell text

9 posts, 0 answers
  1. tyler thompson
    tyler thompson avatar
    13 posts
    Member since:
    Sep 2005

    Posted 16 Oct 2008 Link to this post

    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
  2. Nick
    Admin
    Nick avatar
    767 posts

    Posted 17 Oct 2008 Link to this post

    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.
  3. Damien
    Damien avatar
    4 posts
    Member since:
    Mar 2009

    Posted 18 Jun 2009 Link to this post

    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
  4. Nick
    Admin
    Nick avatar
    767 posts

    Posted 22 Jun 2009 Link to this post

    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.
  5. Damien
    Damien avatar
    4 posts
    Member since:
    Mar 2009

    Posted 22 Jun 2009 Link to this post

    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
  6. Nick
    Admin
    Nick avatar
    767 posts

    Posted 23 Jun 2009 Link to this post

    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.
  7. Damien
    Damien avatar
    4 posts
    Member since:
    Mar 2009

    Posted 23 Jun 2009 Link to this post

    Thanks Nick - yes... unbound mode will do the trick - i should have thought that through a bit more :)

    Cheers,
    Damien
  8. Monika
    Monika avatar
    1 posts
    Member since:
    Jun 2012

    Posted 20 Jun 2012 Link to this post

    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.
  9. Ivan Petrov
    Admin
    Ivan Petrov avatar
    705 posts

    Posted 25 Jun 2012 Link to this post

    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 >>
Back to Top