AvaloniaUI / Avalonia

Develop Desktop, Embedded, Mobile and WebAssembly apps with C# and XAML. The most popular .NET UI client technology
https://avaloniaui.net
MIT License
26.11k stars 2.26k forks source link

Vanishing datagrid vertical gridlines #13050

Open Varmod opened 1 year ago

Varmod commented 1 year ago

Describe the bug When a datagrid column is resized, and the user scrolls horizontally some of the vertical gridlines will vanish. Returns to normal when the datagrid is in it's leftmost position.

To Reproduce

  1. Turn on gridlines visibility
  2. Turn on column resizing
  3. Resize a column
  4. Scroll the datagrid horizontally
  5. See vertical gridlines vanish

Expected behavior Grid lines should not vanish.

Screenshots

  1. Normal Screenshot 2023-09-27 111458

  2. The whole vertical gridlines vanishes if it's close to the left screen Screenshot 2023-09-27 111507

  3. The header vertical gridlines vanishes the moment you resize Screenshot 2023-09-27 111546

Desktop (please complete the following information):

Additional context

timunie commented 1 year ago

looks like a custom style. Please share a sample to reproduce.

Varmod commented 1 year ago

Sample: DatagridLinesIssue.zip

timunie commented 1 year ago

👀 I can reproduce, thx.

Nickelony commented 1 year ago

👀 I can reproduce, thx.

This issue is also there in the default Fluent DataGrid style, but it only affects header cells (all cells below are fine):

GIF

timunie commented 1 year ago

saw it. I have no idea where it comes from atm. Propably some rounding issue during resize. If you have the time to dig into, you may try other rounding strategy in resize method (using samples/ControlCatalog).

IZIDIA commented 5 months ago

Hello. Try setting the property UseLayoutRounding on False.

The problem is precisely rounding. Also, overriding the rounding method inside the table introduces errors. As a result, I cleared the overridden rounding method and use UseLauotRoinding=False

maxkatz6 commented 5 months ago

We might need to set UseLayoutRounding on the lines directly, if it helps.