we have an xamGrid, and set AllowAddNewRow="Bottom", then we can add new row.
however, the system is logined based on different role, how can i hidden the "NewRow" visibility when user who just has read priviledge? we use the MVVM pattern.
thanks.
Hi,
The short answer is "Yes" - you can change dinamically the AllowAddNewRow property to control the visibility/location of the Add New Row.
I believe there is a button in the attached sample that does exactly what you're looking for. It updates the property in the ViewModel and as a result - the visibility of the Add New Row is updated accordingly. Is it not working in your case ? Did you implement INotifyPropertyChanged on your ViewModel, so the bindings are correctly updated upon property change?
can it be changed during the runtime, just described in my previous post?
billion thanks, Georgi.
but there is a question, can we dynamically change the "AllowAddNewRow" property? i mean if there is a button, Readonly or Edit, then it can be controled by the button instead of at the begining of the user login to it.
i tried in my local, it seems failed. is it ok in your side?
Attached a small sample demonstrating the approach described by Konstantin.
Hope this helps,
you could hide the AddNewRow by setting the AllowAddnewRow to None. Regarding the MVVM aproach you're using - you could easily bind this prop to your ViewModel class(probably a converter will be required).
HTH,