Bug with DataTemplate
See original GitHub issueScope: It appears that when DataGridTemplateColumn.CellTemplate is in use the filter freezes and no longer functions.
<control:DataGridTemplateColumn Header="Collection" MinWidth="65" Width="10*" MaxWidth="150" IsColumnFiltered="False">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock x:Name="Collection" Text="{Binding Collection, Mode=OneWay}" MouseDown="DataGridTextColumn_MouseDown"></TextBlock>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</control:DataGridTemplateColumn>
The cause: FieldName and SortMemberPath are not set. Probably should have a default value set somewhere to prevent the app filter from crashing. Possibly get the type of the binding variable and auto set the fieldname, and pull the datacontext/source from the textblock or its parent and auto set the sort member path. <control:DataGridTemplateColumn Header=“MCN” MinWidth=“65” Width=“10*” MaxWidth=“150” IsColumnFiltered=“True” FieldName=“Collection” SortMemberPath=“Collection”>
Issue Analytics
- State:
- Created 8 months ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How can I solve a toolbar bug with DataTemplates?
I tried the ItemTemplateSelector solution but it requires me to put the DataTemplate in the App.xaml resource, cause it doesn't have the ...
Read more >[Bug] DataTemplate instances are initiated with width ...
So it seems that the data template instances are initiated before being 'added' to the collection view, as the converter will initially be ......
Read more >UWP DataTemplate LoadContent has memory leak when ...
Describe the bug When calling DataTemplate.LoadContent , the memory will leak if the root element is not a framework control.
Read more >Databinding bug when using ToolTipContentTemplate and ...
Hi! There is a strange behavior when using ToolTipContentTemplate and in The first time a tooltip is shown everything.
Read more >MapView in ContentPresenter bug?
I was trying to display multiple viewmodels where the DataTemplate contains a MapView in an itemscontrol (TabControl), I discovered that the ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I tried to embed an “intellisense” notification to point out the required field but couldn’t find a way to make it work. It would have been more elegant.
File: FilterDataGrid.cs line 1229 is the issue. The popup is locked as open and never closes. This code change will allow for the filter to still work even though the fieldName is empty.
if (string.IsNullOrEmpty(fieldName)) { popup.IsOpen= true; return; }