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.
Unfortunately, activation email could not send to your email. Please try again.

Find data in grid and highlight cell

Thread ID:

Created:

Updated:

Platform:

Replies:

93412 Mar 11,2010 04:58 PM Mar 22,2010 03:21 AM Windows Forms 8
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On March 11, 2010 04:58 PM

Hello,
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?
Thanks,
Irina

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

Hi Irina,

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

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

Thank you for using Syncfusion products.

Regards,
Jisha

Administrator [Syncfusion]
Replied On March 12, 2010 09:34 AM

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 08:59 AM

Hi Irina,

Please find the sample attached.

REgards,
Jisha



cs_c536e31.zip

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

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 03:36 PM

any updates?

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

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 11:00 AM

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 03:21 AM

Hi Irina,

Thank you for your update.

Regards,
Jisha

CONFIRMATION

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.

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.

;