We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Find Cells and Highlight the Find Results

Good Afternoon,

I am looking for a way to expand on my Find feature that I am using. Right now I am searching a data sequence for example "1001" across multiple rows in a grid. When I find the "4" cells that contain this data I would like to either change the background color or more preferably apply a border to show these are the cells that the search found. Is there a way to do this in Syncfusion?

Thank you,
Bryan

3 Replies

AK Arun Kumar V Syncfusion Team June 14, 2013 04:22 AM UTC

Hi Bryan,

Thanks for your interest in Syncfusion products.

From the reported query it seems that the intention is to highlight records based on filter criteria.

To Highlight Records:

To highlight records you can make use of the PrepareViewStyleInfo event / QueryCellStyleInfo event.

Sample:

I have attached  a sample of how to highlight the current record(Using PrepareViewStyleInfo event). Please use the selection mode tab in the application and choose the available radiobutton mode as such as how you want to highlight the selected grid cells record. 

Link: http://www.syncfusion.com/downloads/Support/DirectTrac/109372/cs.zip

 

//PepareViewStyleInfo event…..

Tweak the customizsation code to get the selected rows..

// Highlight the current row with SystemColors.Highlight and bold font

if (e.RowIndex > grid.Model.Rows.HeaderCount && e.ColIndex > grid.Model.Cols.HeaderCount

&& cc.HasCurrentCellAt(e.RowIndex))

{

e.Style.Interior = new BrushInfo(SystemColors.Highlight);

e.Style.TextColor = SystemColors.HighlightText;

e.Style.Font.Bold = true;

}

Please let me know if you have any concerns.

Regards,

Arun.



BR Bryan Roberts June 17, 2013 03:18 PM UTC

Arun,

Thank you for your help. That is exactly what I was looking for.

-Bryan


AK Arun Kumar V Syncfusion Team June 19, 2013 03:46 AM UTC

Hi Bryan,

We are glad to hear the issue is resolved in your end. Please create a new incident or new forum thread for any of your newer queries.

Regards,

Arun.


Loader.
Live Chat Icon For mobile
Up arrow icon