Minimum code needed to enable Blinking

Good day,

I am trying to enable blinking on a GridGroupingControl.
I am using your GroupingTraderGridTest_2015 as reference which does have blinking which works on my pc.

However when i try to only enable Blinking on my own grid I cannot get it to work.
The below code I got from your example.
In your example you do have a gridGroupingControl1_TableControlPrepareViewStyleInfo event where you check the blink state. I added it just to confirm that blinkstate is always ==None

[Code]
               #region -Blinking
                // Highlight up and downticks
                this.gridGroupingControl1.BlinkTime = 700;  // in ms        //Set blink timer

                //this.gridGroupingControl1.TableDescriptor.Columns[nameof(tblInstrument.ClosingPrice)].AllowBlink = true; //The actual column supposed to be blinking
                foreach (GridColumnDescriptor item in this.gridGroupingControl1.TableDescriptor.Columns)       //Mark all columns as blink to test
                {
                    item.AllowBlink = true;
                }                    
              
                this.gridGroupingControl1.Engine.AddBaseStylesForBlinking();        //Uptick style
                this.gridGroupingControl1.BaseStyles[GridEngine.BlinkIncreased].StyleInfo.TextColor = Color.White;
                this.gridGroupingControl1.BaseStyles[GridEngine.BlinkIncreased].StyleInfo.BackColor = Colors.Green;

                this.gridGroupingControl1.BaseStyles[GridEngine.BlinkReduced].StyleInfo.TextColor = Color.White;
                this.gridGroupingControl1.BaseStyles[GridEngine.BlinkReduced].StyleInfo.BackColor = Colors.Red;


                //This event is just to confirm that blinkstate is = None
                this.gridGroupingControl1.TableControlPrepareViewStyleInfo += new                     GridTableControlPrepareViewStyleInfoEventHandler(gridGroupingControl1_TableControlPrepareViewStyleInfo);
                #endregion

           void gridGroupingControl1_TableControlPrepareViewStyleInfo(object sender, GridTableControlPrepareViewStyleInfoEventArgs e)
        {
            GridTableCellStyleInfo style = (GridTableCellStyleInfo)e.Inner.Style;
            BlinkState bs = gridGroupingControl1.GetBlinkState(style.TableCellIdentity);

            if (bs != BlinkState.None)
            {
                string s = "Debug point here becasue blink works now";
            }
        }
[/Code]

I looked at your Online Documentation and only found one section under GridGroupingControl-> Performance -> BlinkingTime and no other requirements are listed.

So what is the other requirements for Blinking to be enabled?

  1. I tested Column types of int and double.
  2. The grid is the default grid with only the Blink code and the dataSource code being changed.
Regards,
James


Attachment: DataTableToGridGroupingControl_e7fe5b72.zip

3 Replies

JR James Roodt December 8, 2017 09:49 AM UTC

PS. How do you add code blocks that is readable?
[Code] and [/Code] doesn't seem to work.


JR James Roodt December 8, 2017 10:46 AM UTC

Hi there,

I started adding code and suddenly the Blinking started to work.

The line I added was an optimization piece of code as follows:
gridGroupingControl1.UseDefaultsForFasterDrawing = true;

Regards,
James


MG Mohanraj Gunasekaran Syncfusion Team December 11, 2017 09:50 AM UTC

Hi James,    
   
Thanks for your update.   
   
Yes, you were right. In order to use the Blinking support for GridGroupingControl, you should enable the UseDefaultsForFasterDrawing property or disable the InvalidateAllWhenListChanged property to update the Blinking colors for GridGroupingControl. Please refer to the below code example and sample,   
   
Code example   
gridGroupingControl1.UseDefaultsForFasterDrawing = true;   
   
               // (or)   
   
gridGroupingControl1.InvalidateAllWhenListChanged = false;   
   
For more information, please refer the below UG link,   
  
Please let us know if you have any concerns.   
  
Regards,   
Mohanraj G   
 


Loader.
Up arrow icon