Hi,@Mojtaba_Hakim . Welcome Microsoft Q&A.
For the problem System.ArgumentException: 'Object of type 'System.Int32' cannot be converted to type 'System.String'.'
, you did not pay attention to type matching when setting the value.
If you want to set the value in the String column, its type should be String property='4'
. If you set the value to property=4
, you could convert the type through property.ToString();
.
I also read your question here.
For the problem of editing and updating DataGrid data, it is recommended that you use MVVM. You can refer to the documentation Walkthrough: Display data from a SQL Server database in a DataGrid control and How to: Group, sort, and filter data in the DataGrid control for examples. Among them, the data class implements the interface INotifyPropertyChanged, and IEditableObject can implement notifications to edit and update data
----------------------------------------------------------------------------
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.