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.

How do can I get a blinker cell in a GridDataBoundGrid?

 

You can acheive this by providing the backcolor on demand in the PrepareViewStyleInfo event handler and changing this color alternatively in a timers tick event handler. Please refer the following code snippet:

C#

//Setting color on demand

private void gridDataBoundGrid1_PrepareViewStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.GridPrepareViewStyleInfoEventArgs e)

{

if(e.RowIndex > 0 && e.ColIndex > 0)

{

if(e.RowIndex == this.row && e.ColIndex == this.col)

{

e.Style.BackColor = this.color;

}

}

}

//Invoke the Timer

private void timer1_Tick(object sender, System.EventArgs e)

{

this.color = (this.color == Color.White)

? Color.Red : Color.White;

this.gridDataBoundGrid1.InvalidateRange(GridRangeInfo.Cell(this.row, this.col));

}

VB

"Setting color on demand

Private Sub gridDataBoundGrid1_PrepareViewStyleInfo(sender As Object, e As Syncfusion.Windows.Forms.Grid.GridPrepareViewStyleInfoEventArgs) Handles gridDataBoundGrid1.PrepareViewStyleInfo

If e.RowIndex > 0 AndAlso e.ColIndex > 0 Then

If e.RowIndex = Me.row AndAlso e.ColIndex = Me.col Then

e.Style.BackColor = Me.color

End If

End If

End Sub "gridDataBoundGrid1_PrepareViewStyleInfo

"Invoke the Timer

Private Sub timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles timer1.Tick

If (Me.color.Equals(color.White)) Then

Me.color = color.Red

Else

Me.color = color.White

End If

Me.gridDataBoundGrid1.InvalidateRange(GridRangeInfo.Cell(Me.row, Me.col))

End Sub "timer1_Tick

Here is the link with both CS and VB samples: http://help.syncfusion.com/samples/KB/Grid.Windows/GDBG_Blink/

Article ID: Published Date: Last Revised Date: Platform: Control:
489 04/30/2011 07/10/2014 Windows Forms GridDataBoundGrid(Classic)
Did you find this information helpful?
Add Comment
You must log in to leave a comment

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.