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

Add Current Cell Color

Thread ID:





27400 Apr 12,2005 12:07 PM UTC Apr 13,2005 12:35 AM UTC WinForms 1
Tags: GridControl
Jonathan Urban
Asked On April 12, 2005 12:07 PM UTC

Hi, I would like to find a technic to color currrentCell of my dataGrid which already contains a panel control. I found this tips on the KnowledgeBase: When the currentcell is not in edit mode, it is generally a part of the selections. It is just that the current cell is not included when the selection rectangle is drawn. This is by design. If you want to see it colored like other selected cells, then you can handle the CellDrawn event and color it there. Here is some code snippets in C# and VB.NET. [C#] private void gridDataBoundGrid1_CellDrawn(object sender, Syncfusion.Windows.Forms.Grid.GridDrawCellEventArgs e) { GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell; if(e.ColIndex == cc.ColIndex && e.RowIndex == cc.RowIndex) { using(SolidBrush br = new SolidBrush(this.gridDataBoundGrid1.AlphaBlendSelectionColor)) { e.Graphics.FillRectangle(br, e.Bounds); } } } It works perfect with a currentCell without Panel Control. But if the Current Cell contains one Panel Control, it will be colored only after I release the mouse button, not during the Pressure. Can you help me please?

Administrator [Syncfusion]
Replied On April 13, 2005 12:35 AM UTC

I think you can handle this by deriving the panel and overriding its OnPaint method. Here is a little sample. http://www.syncfusion.com/Support/user/uploads/GC_PanelCell_1a482356.zip


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