The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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?
ADAdministrator Syncfusion Team 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