madaxe2020
Well-known member
- Joined
- Sep 7, 2020
- Messages
- 50
- Programming Experience
- 5-10
in my application I can add / remove Continents to the data grid view , this works fine but if i change a name belonging to an existing continent the change is not reflected in the data grid view
what do i have to change to get the data grid view to update
thanks
Madaxe
what do i have to change to get the data grid view to update
thanks
Madaxe
XAML:
<DataGrid x:Name="Dgv_ContinentList"
AutoGenerateColumns="False"
ItemsSource="{Binding continentsCollection,
Mode=TwoWay,
NotifyOnSourceUpdated=True,
UpdateSourceTrigger=PropertyChanged}"
SelectedItem="{Binding Dgv_SelectedItem,
Mode=TwoWay,
NotifyOnSourceUpdated=True,
UpdateSourceTrigger=PropertyChanged}"
ColumnWidth="*"
Background="#FF9F9E9E"
Margin="250,125,50,50" >
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding continent_name}" Header="Continent Name" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding modifying_user_id}" Header="Modifying User" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding modifying_date}" Header="Modification Date" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding status}" Header="Status" IsReadOnly="True"/>
</DataGrid.Columns>
</DataGrid>
Property:
private ObservableCollection<Continent> _continentsCollection;
public ObservableCollection<Continent> continentsCollection
{
get => _continentsCollection;
set
{
if (value == _continentsCollection)
return;
_continentsCollection = value;
base.NotifyPropertyChanged();
}
}
Last edited: