Since Q2 we have introduced a new vital feature for our RadDataGrid – editing. It includes build-in strongly typed editors as well as data validation support. So, using the component for editing scenarios is as simple as possible. Just set UserEditMode and provide the appropriate ItemsSource and you are done.
Of course when we talk about editing, we need some mechanism to validate our data. With our DataGrid we have provided easy to use API through the INotifyDataErrorInfo interface and our ValidateViewModelBase class that implements it. So, if a certain property needs certain validation rules it can do with a few lines of code:
Doing that will provide RadDataGrid with enough information to trigger validation during editing.
The other interesting face of the editing is the flexible MVVM friendly API. RadDataGrid exposes several commands that cover the whole edit operation:
We leveraged the current command infrastructure available in RadDataGrid from the previous versions. Here is an example how to utilize CommitEditCommand:
Tsvyatko Konov is the Lead of UI for Xamarin and UI for UWP team. He is keen on sharing technical experience through mentoring and team development as well as in publications and lectures. In his spare time, TK loves sailing and skiing.
Subscribe to be the first to get our expert-written articles and tutorials for developers!