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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Find data in grid and highlight cell

Thread ID:





93412 Mar 11,2010 09:58 PM UTC Mar 22,2010 07:21 AM UTC WinForms 8
Tags: GridControl
Administrator [Syncfusion]
Asked On March 11, 2010 09:58 PM UTC

I am using Find & Replace Dialog to search on Grid control. It works OK, but I can not change highlighted cell style. It draws dotted border around hardly visible on the screen. I'd like to change back color for found cell, or at least make the border solid/colored. How can I do it?

Jisha Joy [Syncfusion]
Replied On March 12, 2010 09:07 AM UTC

Hi Irina,

You could refer the following sample from the sample browser to achieve the desired behavior.

C:\Syncfusion\\Windows\Grid.Windows\Samples\2.0\MS Excel-Style Features\Grid Find-Replace Demo

Thank you for using Syncfusion products.


Administrator [Syncfusion]
Replied On March 12, 2010 02:34 PM UTC

I am using version 4.402.0.51 so I do not have an access to these samples. Could you zip it for me or direct me to the appropriate sample for 4.4... version?

Jisha Joy [Syncfusion]
Replied On March 15, 2010 12:59 PM UTC

Hi Irina,

Please find the sample attached.



Administrator [Syncfusion]
Replied On March 15, 2010 06:18 PM UTC

I tried the sample you provided and it works fine, except that I can not set borders or back color for static read only cells. My grid has some read only columns, and I can find matchind data in these columns, however back color is not changed.
In the sample you provided i included code which makes 2nd column static read only:

for (int i = 1; i <= gridControl1.RowCount; i++)
gridControl1[i, 2].CellType = "Static";
gridControl1[i, 2].ReadOnly = true;

Is it possible to overwrite style for static columns?

Administrator [Syncfusion]
Replied On March 16, 2010 07:36 PM UTC

any updates?

Clay Burch [Syncfusion]
Replied On March 17, 2010 08:51 AM UTC

It is the ReadOnly setting that is preventing you from changing the cell style through code.

One comment is that if you make the cell Static, usually there is no need to also set it to ReadOnly as your user will not be able to type into a Static celltype.

If you want to keep using the ReadOnly cell style setting, then to make programatic changes to such ReadOnly styles, you need to first set the grid's IgnoreReadOnly property to true as in:

gridControl1.IgnoreReadOnly = true;
gridControl1[row, col].BackColor = Color.Red;
gridControl1.IgnoreReadOnly = false;

Administrator [Syncfusion]
Replied On March 17, 2010 03:00 PM UTC

Thanks for the update. For some reason, this change does not work for our grid, may be because I assign style properties in runtime. So I left colStyleInfo.ReadOnly = true; in place and removed colStyleInfo.CellType = "Static"; This seems to do the trick.

Jisha Joy [Syncfusion]
Replied On March 22, 2010 07:21 AM UTC

Hi Irina,

Thank you for your update.



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon