I
I
Igor Dmitrashko2020-02-20 18:57:34
.NET
Igor Dmitrashko, 2020-02-20 18:57:34

How to get data from DataGrid?

I get data from the database, fill the sheet with data and display the sheet in the DataGrid using dataGrid.itemsSource = List Here
is the DB object itself: int
Id , string ,decimal , DateTime further column size and so on DataGridTextColomn Binding {Money} further column size and so on DataGridTextColomn Binding {Date} further column size and so on And if I change some cells in the DataGrid then how can I get a sheet from the DataGrid in which something has changed?


Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladislav, 2020-02-21
@Gorik2927

Make a data binding.

<DataGrid ItemsSource="{Binding CollectionTechWallets}"/>

And in the class, create a collection into which you will write the received data.
But you still have to implement the INotifyPropertyChanged interface in order for the DataGrid to know that your CollectionTechWallets has changed and it will automatically update the data.
When you change the data in the DataGrid, it will automatically change in your CollectionTechWallets

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question