Hello, Welcome to Micorosoft Q&A,
DataGrid.EnableRowVirtualization is not available in UWP
EnableRowVirtualization, please refer document, it is desktop top DataGrid property, it is not apply to UWP DataGrid. And UWP DataGrid
is enable virtualization automatically. If you want to disable checkbox auto overwrite, please binding it with specific bool property.
<controls:DataGridTemplateColumn Header="Serach" Visibility="Collapsed">
<controls:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<CheckBox Content="{Binding Name}" IsChecked="{Binding Complete}" />
</StackPanel>
</DataTemplate>
</controls:DataGridTemplateColumn.CellTemplate>
</controls:DataGridTemplateColumn>
Model Class
public class Item :INotifyPropertyChanged
{
public string Name { get; set; }
public bool IsSearch { set; get; }
private bool _complete;
public bool Complete
{
get
{
return _complete;
}
set
{
_complete = value;
OnPropertyChanged();
}
}
public event PropertyChangedEventHandler PropertyChanged;
private void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
If you do want to disable virtualization, you may try to place DataGrid in the ScrollViewer
, please note disable virtualization will consume more memory and degrade performance.
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.