New to Telerik UI for WPF? Start a free 30-day trial
Prevent GridView Column Resize on Mouse Double-Click
Updated on Sep 15, 2025
Environment
| Product Version | 2022.2 621 |
| Product | RadGridView for WPF |
Description
RadGridView column resizes, when a double-click is performed between the header cells.
Solution
- Add a new event handler for the
PreviewMouseDoubleClickevent of theGridViewHeaderCellelement via theAddHandlermethod.
Add a new event handler for the PreviewMouseDoubleClick of the GridViewHeaderCell element
C#
this.AddHandler(GridViewHeaderCell.PreviewMouseDoubleClickEvent, new MouseButtonEventHandler(OnPreviewMouseDoubleClick));- In the new event handler, set the
e.Handledproperty totrue, if thee.OriginalSourceis of typeBorder.
Prevent the PreviewMouseDoubleClick event from bubbling if the OriginalSource is of type Border
C#
private void OnPreviewMouseDoubleClick(object sender, MouseButtonEventArgs e)
{
if (e.OriginalSource is Border)
{
e.Handled = true;
}
}