You can do this by subclassing your grid and overriding OnMouseMove, and not calling the baseclass if the point is on the columnsizing border.
[C#]
public class CustomDataGrid : DataGrid
{
// prevent display of resizing cursor
protected override void OnMouseMove( MouseEventArgs e )
{
DataGrid.HitTestInfo hti = HitTest( new Point( e.X, e.Y ) );
if ( hti.Type == DataGrid.HitTestType.ColumnResize )
return; // don't call base class
base.OnMouseMove( e );
}
// prevent user from resizing column
protected override void OnMouseDown( MouseEventArgs e )
{
DataGrid.HitTestInfo hti = HitTest( new Point( e.X, e.Y ) );
if ( hti.Type == DataGrid.HitTestType.ColumnResize )
return; // don't call base class
base.OnMouseDown( e );
}
}
George Shepherd, Syncfusion, and Stephen Muecke