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

Style of a cell flickering

Thread ID:





69221 Oct 18,2007 09:15 PM UTC Oct 22,2007 03:23 PM UTC WinForms 4
Tags: GridControl
Alexei Ostrov
Asked On October 18, 2007 09:15 PM UTC

I am using GridControl.
I am setting 3 levels of styles.
1. The background style for the whole Grid range. This is done on Grid setup.
2. As I have a custom FilterBar in the first row I am setting a specific style for it as well. This is done on Grid setup.
3. The third style is the style of the specific cell that was just modified (or previously) by the user. This is done in QueryCellInfo like so:
CustomRowBarEventArgs args =
new CustomRowBarEventArgs(e.RowIndex, GetFieldIdFromColIndex(e.ColIndex),
column.CacheIndex, e.Style);
e.Handled = true;

In the same handler I see and ignore requests for the style of the whole FilterBar row, as it seems redundant.

The problem that I see is that I see flicker between the RowStyle and CellStyle on each grid update (every half a second) in the cell of the FilterBar that already has a value and is being edited. Also, the cursor jumps between positions in the cell string.
It looks like I am missing something trivial like
type of thing...
Could you please point me into the right direction?

Administrator [Syncfusion]
Replied On October 19, 2007 12:01 PM UTC

QueryCellInfo is raised several times for each cell.

When e.RowIndex and e.ColIndex are both -1, then the request is for the style associated with grid.TableStyle.

When e.RowIndex > 0 and e.ColIndex == 0, then the request is for the row style, grid.RowStyles[e.RowIndex].

When e.RowIndex == 0 and e.ColIndex > 0, the request is for grid.ColStyles[e.ColIndex].

It is only when both e.RowIndex and e.ColIndex are nonnegative that the grid is requesting the particular cell style. So, you may want only want to raise the event when the grid is requesting a cell style to see if that will avoid the problem you are seeing.

Alexei Ostrov
Replied On October 19, 2007 02:50 PM UTC

thank you very much for your answer.
I should have been clearer in what I am doing. As I said, I am ignoring the requests for row and column styles. In fact, I am ignoring anything other than my custom filter bar cells indexes.
After a bit more experimenting, I see that I see flicker even when I only set different style for my row like this:
if (e.ColIndex < 0) // this is asking for dynamic style of the row whose index is passed
if (e.RowIndex == ((CustomRowBar)FilterBar).CustomRowIndex)

private void forDebugOnlySetFilterStyle(GridStyleInfo style)
style.Font.Bold = false;
style.BackColor = Color.LightBlue;
style.TextColor = Color.Black;
style.CellType = GridCellTypeName.TextBox;
style.ReadOnly = false;

As a side note, my grid is about 3500 rows by 10 columns (but this should not be the limit).
My group has inherited this grid and it is in pretty bad shape. I am pretty new to GridControl but intend to fix it up.

Thank you very much for your help.

Administrator [Syncfusion]
Replied On October 19, 2007 04:12 PM UTC

You can try sandwiching this code that changes the style between

//change code...

to see if this avoids the flicker.

Alexei Ostrov
Replied On October 22, 2007 03:23 PM UTC

This was caused mostly by our own code. I achieved by locking CurrentCell.

Thank you for your help


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