Git Product home page Git Product logo

Comments (8)

CleverSnowy avatar CleverSnowy commented on May 31, 2024

I observe the same issue. And it seems that this occurs especially if there's a lot of data to be loaded, and scrolling-speed is high. If I scroll slowly (e.g. using the arrow-buttons instead of the mouse, or also just slowly with the mouse-wheel), then content is loaded in dynamically fine. But if I scroll "quickly", suddenly the cell within one row get shifted around (same as in the picture above).
Also note: I'm using TemplateColumns.

Could it be, that the dynamic reloads due to changed viewport during scrolling is somehow messing up the row presenters?

Would really be great to have this fixed, as it's kind of breaking the usage of TreeDataGrid fully (I'm looking for a workaround...)

from avalonia.controls.treedatagrid.

dexchix avatar dexchix commented on May 31, 2024

I solved this problem by making 2 columns instead of 4, i.e. 1(1) - 2(2-4) and made a large template for the 2nd column (which replaces 3) and the bug disappeared, this may help you out

from avalonia.controls.treedatagrid.

CleverSnowy avatar CleverSnowy commented on May 31, 2024

Nice one! Yes, that works. Not ideal, but it's a working workaround ;) Thanks!

from avalonia.controls.treedatagrid.

moskalevkn17 avatar moskalevkn17 commented on May 31, 2024

I've got the same Issue when used this template:

<TreeDataGrid Source="{Binding Source}" ShowColumnHeaders="False">
  <TreeDataGrid.Resources>

    <DataTemplate x:Key="Names">
      <ContentPresenter Content={Binding}>
        <ContentPresenter.DataTemplates>

          <DataTemplate DataType="{x:Type vm:ClassA}">
            <TextBlock Text="{Binding Name}"/>
          </DataTemplate>

          <DataTemplate DataType="{x:Type vm:ClassB}">
            <TextBlock Text="{Binding Name}"/>
          </DataTemplate>

        </ContentPresenter.DataTemplates>
      </ContentPresenter>
    </DataTemplate>
  </TreeDataGrid.Resources>
</TreeDataGrid>

I want to use this control as virtualized TreeView.

from avalonia.controls.treedatagrid.

danipen avatar danipen commented on May 31, 2024

Can you try with latest changes on master?. There are some new fixes that probably fix this issue.

from avalonia.controls.treedatagrid.

moskalevkn17 avatar moskalevkn17 commented on May 31, 2024

Can you try with latest changes on master?. There are some new fixes that probably fix this issue.

It doesn't seem to resolve my issue. Example to reproduce this bug: https://github.com/moskalevkn17/AvaloniaTreeDataGridBug/tree/bugExample

I added a new tab "Diffs" in TreeDataGridDemo. If you scroll through an items quickly, you will see that they are randomly mixing.

from avalonia.controls.treedatagrid.

moskalevkn17 avatar moskalevkn17 commented on May 31, 2024

If I change ContentPresenter with ContentControl then bug will disappear.

from avalonia.controls.treedatagrid.

windracer avatar windracer commented on May 31, 2024

The bug is still here and it is easily reproducible in the Sample App from this repo. Just download it, compile it, and run it without any modifications except updating Nuget packages to the latest versions (this step is optional). Switch to the Wikipedia tab, wait for the content to be completely loaded, then scroll the content up and down by pressing the Up and Down arrows. After several iterations, you'll see the following (see the screenshot).

The bug is reproducible in Mac OS and Windows. In addition to the entries shifted you can notice artifacts from the selection which don't disappear. There's no actual selection on the screenshot, everything is an artifact.

The screenshot

from avalonia.controls.treedatagrid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.