-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
DataGrid not propagating the changes to its child DataGridTemplateColumn elements #18020
Comments
Another way to put it into words is that the Dynamic MenuFlyout "popup" doesnt get refreshed when it is placed inside a DataGrid's row that has loaded other rows before, then removed the rows and then added new rows. |
Does MyUrlList correctly raise propertyChanged? Please provide a minimum sample to investigate |
Here is an example: |
The UrlList can be either List or ObservableCollection but it fails both ways because that property is not the one changing, it is the parent object (the Person object) that contains that list, that is changing, which is part of an ObservableCollection binded to the DataGrid. <MenuFlyout ItemsSource="{Binding UserLinks}">
<MenuFlyout.ItemTemplate>
<DataTemplate DataType="model:Link">
<MenuItem Header="{Binding LinkName}"/>
</DataTemplate>
</MenuFlyout.ItemTemplate>
</MenuFlyout> I found that simpler way by manually testing, the version using |
I was trying alternative methods to setup the MenuItems to have my app working without waiting for a possible fix. <MenuFlyout>
<ItemsRepeater ItemsSource="{Binding UserLinks}" >
<ItemsRepeater.ItemTemplate>
<DataTemplate>
<MenuItem Header="{Binding LinkName}"/>
</DataTemplate>
</ItemsRepeater.ItemTemplate>
</ItemsRepeater>
</MenuFlyout> |
I have narrowed it down to particularly the So the bug seems to be in |
Describe the bug
In a DataGrid, if you add an item to it,
that has a sub list property
List<string> MyUrlList {get; set;}
with some urls setted and binded to a
DataGridTemplateColumn > SplitButton > MenuFlyout > ItemsSource
,it loads the row correctly, and the SplitButton.Flyout shows the list of 2 items.
BUT, if you remove the row item from the DataGrid and replace it with another one,
the first row in the DataGrid updates correctly each cell except for
the
SplitButton.Flyout
that is still pointingto the list of the first element ever loaded in that position of the DataGrid,
instead of refreshing it.
DataGrid got the update notification and updated the rest of the values,
but DataGrid didn't notify the child
SplitButton.Flyout
to update it'sItemsSource
.This is a nasty bug because everything looks like it works but then the links and data inside are referencing another person/object!
To Reproduce
AXAML Example:
Expected behavior
No response
Avalonia version
11.2.3
OS
Windows
Additional context
No response
The text was updated successfully, but these errors were encountered: