Comments (6)
This problem is related not to the master branch but to #8
from avalonia.controls.treedatagrid.
@danipen @miryamGSM Would it be possible for you guys to provide more info about this issue or some repro?
From my POV it's impossible for OnAttachingToLogicalTree to be called without creating of cell. So if cell is created this code makes sense and no additional validations are needed.
from avalonia.controls.treedatagrid.
Hi @Takoooooo, unfortunately I don't have a minimal example to reproduce this issue, and I'm afraid that it's not easy to build, since I'm not sure why/when it happens (it happens "sometimes" when switching from views, and re-creating the TreeDataGrid).
As you can see in the image, there are a unwanted state:
- The method OnAttachedToLogicalTree is raising the event RaiseCellPrepared for row 0.
- However, the TreeDataGrid has no rows at this moment (the _treeDataGrid.Rows collection is empty).
Is feasible to protect this scenario? Does it make sense for you?
from avalonia.controls.treedatagrid.
@danipen The problem is what protecting it doesn't really have a sense. OnAttachingToLogicalTree
should not be called because we don't create any rows and the Rows collection is empty. I tried to make a test which would repro this but unsuccessfully. And also we cant just blindly protect that because it doesn't have a sense. I can only suggest you to make the repro or to protect from that locally in your code
from avalonia.controls.treedatagrid.
There's a repo of this on the repro-cases/wrong-index-raise-cell-prepared
branch.
from avalonia.controls.treedatagrid.
Taken a look at the repro and the problem seems to be that:
TreeDataGridExpanderCell
contains an "inner" cell that is used to display the cell data- When
TreeDataGridExpanderCell
gets realized, it callsUpdateContent
to realize the inner cell, settingRowIndex
/ColumnIndex
- When
TreeDataGridExpanderCell
gets unrealized,UpdateContent
gets called again, but it doesn't unrealize the inner cell because_model
is already set tonull
here
I think we just need to remove that think that when _model is null
check in TreeDataGridExpanderCell.UpdateContent
.model is null
we need to call Unrealize()
on the inner cell.
from avalonia.controls.treedatagrid.
Related Issues (20)
- [Bug] Scrolling a control with variable row height causes visual clatter.
- [Bug] Cannot deselect row when SingleSelect is enabled
- Downloading fresh zip of Avalonia.Controls.TreeDataGrid current as of 2024-02-20, compile has build errors in the test components. HOT 2
- Row Focus Order Does Not Match Visible Order HOT 1
- TreeDataGridDemo, GitHub snapshot to ReactiveUI to CommunityToolKit.Mvvm in proper MVVM form HOT 2
- TreeDataGrid and VerticalScrollBarVisibility & VerticalScrollBarVisibility don't work HOT 3
- TreeDataGridPresenterBase Replace Regression
- [Question] How to end cell editing when clicking outside TreeDataGrid control?
- How can you sort a TreeDataGrid by column programatically?
- Missing text in column headers when changing TreeDataGrid from read-only to edit mode HOT 1
- The items are not sorted after setting column SortDirection, despite the column header shows arrow. HOT 1
- How to implement double-click on Row or Cell selection to display detailed view.
- Add `StringFormat` to `TextColumn<TModel,TValue>` options HOT 1
- CanUserResizeColumn and Sort Arrow Spacing
- HierarchicalExpanderColumn is truncated when scrolling up/down if template is complicated
- Page Up/Down Selection Glitches HOT 1
- [Feature] Allow remove `Columns` from `Source` HOT 1
- Consider making `TreeDataGrid` more extensible. HOT 2
- [Question] New Release? HOT 2
- Best way to deal with IObservable values
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from avalonia.controls.treedatagrid.