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,
can anyone tell me if there is a quick way to establish which cell the mouse is positioned over? I guess I'm looking for an equivalent to the standard tree control's GetNodeAt(X, Y) method.
Thanks in advance
David Loomes
ADAdministrator Syncfusion Team August 11, 2003 03:36 PM UTC
You can use the GridControl1.PointToRowCol method.
Point clickPoint = gridControl1.PointToClient (Cursor.Position);
int row, col;
gridControl1.PointToRowCol(clickPoint, out row, out col);
this.label1.Text = col.ToString();
DLDavid LoomesAugust 11, 2003 06:13 PM UTC
Clay,
Many thanks, I found this function eventually!
There appears to be a problem with the drag/drop behaviour, the DragOver event is unable to change the displayed cursor by changing e.Allowed in the usual way, and DragDrop seems only to be fired after the grid has completed its own drop handling. I managed to get round this by creating my own grid derived from GridControl and overriding OnDragOver and OnDragDrop to pass control to a new event handler. The code (in C++) is below, but this seems like a lot of trouble to go to to get normal drag/drop handling, and inevitably leads to yet another dll in my project.
Hope this is of some use!
public __gc class MyGridControl : public Syncfusion::Windows::Forms::Grid::GridControl
{
public:
__event DragEventHandler *MyDragOver, *MyDragDrop;
Void OnDragDrop(System::Windows::Forms::DragEventArgs __gc *e)
{
if (MyDragDrop)
MyDragDrop->Invoke(this, e);
}
Void OnDragOver(System::Windows::Forms::DragEventArgs __gc *e)
{
if (MyDragOver)
MyDragOver->Invoke(this, e);
}
};