I've created a virtual tree grid based on the sample project you provide ('VirtTreeGrid') and noticed that in both my grid and the sample a selection cannot be initiated when the first cell clicked on is one of the cells that uses the 'TreeCellModel'. What can I do get around this?
ADAdministrator Syncfusion Team May 14, 2003 02:25 PM
The OnHitTest returns a nonzero anytime the mouse is over one of the treecells. This means the selection mouse controller that manages selecting cells does not get a crack at selecting things. So, if you want to allow selections, you will have to refine teh OnHitTest to only return a nonzero when you do not want the selection controller to handle things. Below is a snippet that returns a non-zero only if the mouse is over the cell bitmap.
protected override int OnHitTest(int rowIndex, int colIndex, MouseEventArgs e, IMouseController controller)
if(e.Button != MouseButtons.None )
Rectangle rect = GetCellBoundsCore(rowIndex, colIndex);
int X = rect.X + IndentSize * (int)this.Grid.Model[rowIndex, colIndex].Tag;
rect.X = X;
rect.Width = this.bitmapWidth;
rect.Height = this.bitmapHeight;
if(rect.Contains(new Point(e.X, e.Y)))