WPF DataGrid with 1 frozen column - horizontal scroll problem
- Dominant language
- C#
- Stars
- 7.7k
- Forks
- 1.3k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 61
Description
_This issue has been moved from [a ticket on Developer Community](https://developercommunity2.visualstudio.com/t/WPF-DataGrid-with-1-frozen-column---hori/922614)._
---
I have a very simple WPF app with a DataGrid with 1 frozen column. When I scroll horizontally (to the right or left) by clicking in the empty portion of the scrollbar, I scroll too far- probably by the width of the frozen column. (Other ways of scrolling, dragging the thumb, clicking the right or left arrowhead buttons, work fine). I have a few rows and 10 columns, Col00 thru Col09. Col00 is frozen. A click in the area shown in the image causes scrolling too far- skipped Col04.
Image:119348-horizscrollproblem.png
XAML and C# shown below...
RowOfCells is my class of 10 public properties, Col00 thru Col09.
I have built in VS2015 (.Net 4.6.1) and VS2017 (.Net 4.7.2 and .Net 4.8), and ran in Win10 ver.1909.
I have tried many different ways of creating this simple app but the behavior is always the same. The behavior is unaffected by the presence of the vertical scrollbar.
If I remove the frozen column then all ways of scrolling are fine, but I need that 1 frozen column.
Is there a fix for this? Or a work-around? Thank you for your time.
<Window x:Class="TestDatagridScroll.MainWindow"
xmlns="<the usual URL>"
xmlns:x="<the usual URL>"
Title="TestDataGridScroll" Height="198" Width="343">
<Grid>
<DataGrid Name="dg" AutoGenerateColumns="True" FrozenColumnCount="1" >
</DataGrid>
</Grid>
</Window>public MainWindow()
{
InitializeComponent();
List<RowOfCells> rowOfCellsList = new List<RowOfCells>();
RowOfCells rowOfCells = null;
for (int i = 0; i < 20; i++) // generate some data rows
{
rowOfCells = new RowOfCells();
rowOfCells.Col00 = $"TextCol00-{i:D2}";
rowOfCells.Col01 = $"TextCol01-{i:D2}";
rowOfCells.Col02 = $"TextCol02-{i:D2}";
rowOfCells.Col03 = $"TextCol03-{i:D2}";
rowOfCells.Col04 = $"TextCol04-{i:D2}";
rowOfCells.Col05 = $"TextCol05-{i:D2}";
rowOfCells.Col06 = $"TextCol06-{i:D2}";
rowOfCells.Col07 = $"TextCol07-{i:D2}";
rowOfCells.Col08 = $"TextCol08-{i:D2}";
rowOfCells.Col09 = $"TextCol09-{i:D2}";
rowOfCellsList.Add(rowOfCells);
}
dg. ItemsSource = rowOfCellsList;
}
---
### Original Comments
#### Feedback Bot on 2/20/2020, 09:02 AM:
We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.
#### Bruce Aker on 2/26/2020, 02:39 PM:
The same incorrect behavior happens with .Net Core 3.1 and VS2019
#### Feedback Bot on 3/27/2020, 09:52 AM:
I have detected that for the last 35 days, this issue didn't have much product team activity and a very small amount of new votes or comments. Based on this, its severity, and affected area, it’s my experience that this issue is very unlikely to be fixed.
---
### Original Solutions
(no solutions)
Contributor guide
Assessment
This issue has not been assessed yet.