I am looking for the proper WPF control(s) to display a list of strings subject to the following constraints:
1. The user can edit the single item
2. There may be some "empty" items
3. The code must have access to the list content before and after the editing
Maybe a ListBox or a ListView. Despite spending many hours searching for documentation and examples I am not sure yet if and how to make the list items editable. I am a novice... sigh
Thank you in advance.
Sachin SinghPosted Feb 20, 2022, 5:51 AM
Muhammad Imran AnsariPosted Feb 20, 2022, 1:57 PM
Satya KarkiPosted Feb 20, 2022, 1:23 PM
Rijwan AnsariPosted Feb 20, 2022, 12:18 PM
You can use datagrid control, which basically, an editable gridview.
Example:
Create a class that represents a row:
And set the ItemsSource property of the DataGrid to a collection of such objects:
XAML:
Sachin SinghPosted Feb 20, 2022, 11:25 AM
Maura MonvillePosted Feb 20, 2022, 11:06 AM
This is an answer to Mr SACHIN SINGH.
Thank you for your complete solution.
Unluckily the C# compiler tells me "StringContainer does not implement interface INotifyPropertyChanged "
So I am pretty much stuck here.
Any suggestion?
Thanks