DataGrid Bindings #3995
Unanswered
maxzaikin
asked this question in
Questions & Help
Replies: 3 comments 1 reply
-
up please |
Beta Was this translation helpful? Give feedback.
0 replies
-
Looping in @anawishnoff and @RBrid to provide insight ⬆️ |
Beta Was this translation helpful? Give feedback.
0 replies
-
Is this working in UWP with the existing control and not WinUI 3 or you've only tested in WinUI 3? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi All,
could you please help me to understand what am I did wrong... I' m learning DataGrid possibilities and has successfully married DataGrid with my VM via MainWindow code behind:
_datagrid.ItemsSource = _viewModel.Lines;
so this work perfectly fine, I can add lines and can have response back via ObservableCollection mechanism, so no issues with that. The thing where I'm sort of lost is how to make proper response when selected item has been changed in datagrid?
I have add a property in my MainViewModel file:
private MntsDataItem _selectedLine; public MntsDataItem SelectedLine { get { return _selectedLine; } set { if (_selectedLine != value) { _selectedLine = value; RaisePropertyChanged(); } } }
and I have add following line in datagrid xaml:
SelectedItem="{Binding SelectedLine, Mode=TwoWay}"
But unfortunately this link is not working...
Please could you explain for dummy what I did wrong and why...
Appreciate your help,
Looking forward for response,
Best regards,
Maks.
P.S.
I. using VS2019 enterprise =, WinUI 3.0 Desktop app.
Beta Was this translation helpful? Give feedback.
All reactions