I am using WPF, the column of text box is my custom to go up, then I have to be the new operation here, in the background for the line of the corresponding columns of text box I choose their own value, but now I can only get to later input values in the text box, I also tried to get the value of a column, using the code
Do you have what method can get into this value, bother to code, I am a rookie, also don't know much about the theory, thank you for your attention
CodePudding user response:
Use MVVM, input interface binding of the value of the background data source is updated directly, don't need that trouble to the interfaceCodePudding user response:
Using MVVM is very convenient to solve this problem, youDon't consider this way to obtain: DataRowView mySelectedElement=(DataRowView) dataGrid1. SelectedItem;
In need of new lines, the DataGrid ObservableCollection
{Binding you need to get the attribute value, Mode=OneWayToSource}
So you the background to obtain ObservableCollection
CodePudding user response:
WPF is don't want to go Winform that through controls access to data, based on "data binding mechanism put focus on data processing, see # 2's advice,