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

Autoscroll implementation for TreeDataGrid #324

Open
Dave-Krch opened this issue Dec 10, 2024 · 0 comments
Open

Autoscroll implementation for TreeDataGrid #324

Dave-Krch opened this issue Dec 10, 2024 · 0 comments

Comments

@Dave-Krch
Copy link

I have managed to scroll TreeDataGrid using this method in MainWindow.axaml.cs:

private void ScrollTreeDataGrid()
{
    var vm = DataContext as MainWindowViewModel;
    if (vm != null && vm.AutoScrollData)
        tdGrid.Scroll.Offset = tdGrid.Scroll.Offset.WithY(tdGrid.Scroll.Extent.Height);
}

I need to call this every time the source for TreeDataGrid is updated, but i did not find any event that i can use.
Items are being added to the Source using this method in ManWindowVIewModel:

public void AddItem(ASN1Type msg)
{
    DecodedMessages.Add(new ReceivedMessageModel(MsgCount, DateTime.Now, v2Xinterface.Config.Port, v2Xinterface.Config.IPAddress, msg));
    MsgCount++;
}

Is there an event form TreeDataGrid that i am mising? Or is there a way i can acces the TreeDataGrid from the ViewModel and set the scroll there?

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

No branches or pull requests

1 participant