Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating Source causes star-sized columns to collapse #130

Closed
SuperJMN opened this issue Sep 16, 2022 · 1 comment · Fixed by #242
Closed

Updating Source causes star-sized columns to collapse #130

SuperJMN opened this issue Sep 16, 2022 · 1 comment · Fixed by #242

Comments

@SuperJMN
Copy link
Contributor

I was trying to overcome this issue. To do so, I set a new Source every time the model changes, in order to force the TreeDataGrid to update its contents.

However, this has led me to another bug:

  • When TreeDataGrid.Source is set the 1st time, things go OK
  • but when you try set it afterwards, star-sized columns collapse.
TreeDataGridWeirdColumn_JmNitN6nAj.mp4

The code to reproduce this is really simple. You can reproduce it by cloning this repo

TreeDataGrid version: 0.10.10

@FrayxRulez
Copy link

This should be relatively easy to address, as a workaround we're doing this right after setting the Source:

void layoutUpdated(object? sender, EventArgs e)
{
    Tree.LayoutUpdated -= layoutUpdated;

    var c = Tree.RowsPresenter?.GetVisualParent();
    if (c != null)
    {
        Tree.RowsPresenter?.Columns?.ViewportChanged(new Rect(0, 0, c.Bounds.Width, c.Bounds.Height));
    }
}

Tree.LayoutUpdated += layoutUpdated;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants