AvaloniaUI / Avalonia.Controls.TreeDataGrid

A combined TreeView/DataGrid for Avalonia.
MIT License
234 stars 49 forks source link

How to focus on cell? #248

Closed artizzq closed 5 months ago

artizzq commented 6 months ago

I know that I can select cell by defining CellIndex and after that put it to SelectedIndex variable. Then I find the cell manually and see that its really selected.

So how do I scroll into the selected cell automatically?

Tried TryGetCell method (I got Null exception), messing around with scrollbars of the TreeDataGrid (Misplaced and messed up header and rows) but no luck.

maxkatz6 commented 5 months ago

You might need to call BringIntoView(rowIndex) first to get row materialized. And then focus.

If row/cell is outside of the viewport, its container won't exist, so there would be nothing to focus.

artizzq commented 5 months ago

Big thanks for help! 😌