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. Image for the cookie policy date
close icon

TreeCell Selection

Hi,

In the Virtual TreeGrid example, How to enable selecting multiple cells starting from one of the TreeCells by holding mouse.

Thanks,

Q


1 Reply

HA haneefm Syncfusion Team November 9, 2007 10:55 PM UTC

Hi Q,

You need to override the TreeCellRenderer's OnHitTest and OnClick method to solve this issue in a VitrualTreeGridControl. Below are the codes that shows this task.

protected override int OnHitTest(int rowIndex, int colIndex, MouseEventArgs e, IMouseController controller)
{
if(e.Button != MouseButtons.None )
{
return GridHitTestContext.None ;
}
else
return 0 ;
}

protected override void OnClick(int rowIndex, int colIndex, System.Windows.Forms.MouseEventArgs e)
{
//if you call ClickTreeNode here instead of OnMouseDown,
//then the action is done later after the mouseup...
ClickTreeNode(rowIndex, colIndex, e);
base.OnClick(rowIndex, colIndex, e);
return;
}

Here is a sample for reference.
VirtualTreeSelectionModified.zip

Best regards,
Haneef


Loader.
Live Chat Icon For mobile
Up arrow icon