WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# How to resize the row header column in WPF DataGrid(SfDataGrid)?
# How to Resize the Row Header Column in WPF DataGrid?

## About the sample
This example illustrates how to resize the row header column in [WPF DataGrid](https://www.syncfusion.com/wpf-controls/datagrid) (SfDataGrid).

This example illustrates how to resize the row header column in [WPF DataGrid](https://www.syncfusion.com/wpf-ui-controls/datagrid) (SfDataGrid)?

[WPF DataGrid](https://www.syncfusion.com/wpf-ui-controls/datagrid) (SfDataGrid) does not provide the direct support to resize the row header column. You can resize the row header column by overriding the [GridRowHeaderCell](https://help.syncfusion.com/cr/cref_files/wpf/Syncfusion.SfGrid.WPF~Syncfusion.UI.Xaml.Grid.GridRowHeaderCell.html) and [GridRowHeaderIndentCell](https://help.syncfusion.com/cr/cref_files/wpf/Syncfusion.SfGrid.WPF~Syncfusion.UI.Xaml.Grid.GridRowHeaderIndentCell.html) by triggering the Thumb.DragDelta event.
`DataGrid` does not provide the direct support to resize the row header column. You can resize the row header column by overriding the [GridRowHeaderCell](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowHeaderCell.html) and [GridRowHeaderIndentCell](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowHeaderIndentCell.html) by triggering the **Thumb.DragDelta** event.

```xml
<Window.Resources>
Expand Down Expand Up @@ -242,13 +240,11 @@ This example illustrates how to resize the row header column in [WPF DataGrid](h
```c#
private void PART_RightHeaderGripper_DragDelta(object sender, System.Windows.Controls.Primitives.DragDeltaEventArgs e)
{
SfDataGrid sfDataGrid = (sender as Thumb).Tag as SfDataGrid;
var width = sfDataGrid.RowHeaderWidth + e.HorizontalChange;
if (width >= 24)
sfDataGrid.RowHeaderWidth = width;
SfDataGrid sfDataGrid = (sender as Thumb).Tag as SfDataGrid;
var width = sfDataGrid.RowHeaderWidth + e.HorizontalChange;
if (width >= 24)
sfDataGrid.RowHeaderWidth = width;
}
```
KB article - [How to resize the row header column in WPF DataGrid(SfDataGrid)?](https://www.syncfusion.com/kb/11517/how-to-resize-the-row-header-column-in-wpf-datagrid-sfdatagrid)

## Requirements to run the demo
Visual Studio 2015 and above versions
![DataGrid with resizing row header column](ResizingRowHeader.gif)
Binary file added ResizingRowHeader.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.