Hi Gian Piero Truccolo,
We suspect that your requirement is to change the datasource of the grid when changing
the Source property bound with the ItemsSource property in SfDataGrid.
You can achieve this by implementing the Source property with INotifyPropertyChanged.
Please refer to the below code snippet,
|
public class VIew : INotifyPropertyChanged
{
private
ObservableCollection<dynamic> _Source;
public ObservableCollection<dynamic>
Source
{
get
{
return _Source;
}
set
{
_Source =
value;
OnPropertyChanged("Source");
}
}
public event PropertyChangedEventHandler
PropertyChanged;
public void OnPropertyChanged(string PropertyName)
{
if (PropertyChanged != null)
PropertyChanged(this, new PropertyChangedEventArgs(PropertyName));
}
}
|
UG Link: https://help.syncfusion.com/wpf/datagrid/columns#autogeneratecolumns-with-different-modes
https://help.syncfusion.com/wpf/datagrid/data-binding
Please find the modified sample in the attachment and let us know if you have
any concerns in this.
Regards,
Vijayarasan S
Attachment:
ModifiedSample_abd820bf.zip