mvvm - enable/disable data grid columns using ivalue convertor in silverlight -
i working on silverlight application using mvvm. requirements display existing user data in data grid first 2 columns remains non-editable , rest editable.
at start datagrid loads data database, @ point if user click on data grid first 2 columns should non-editable.
after user insert new row (i create button, when clicked new row added @ bottom of grid) columns should editable including first two. user can click add row buttons more once, point rows created add button click should editable.
i stuck @ problem since yesterday great!
i dont know silverlight think following should work: on command add new row, set flag "allrowseditable" true , throw propertychanged property. in view bind isreadonly property of first 2 columns "allrowseditable" property.
edit: write viewmodel datagrid items. example "rowviewmodel". have structure introduce 2 properties "isfirstpropertyreadonly" , "issecondpropertyreadonly" in viewmodel. "...firstproperty..." properties name. in xaml can bind properties. in first initialization load items , set property values true. items added after set properties false.
Comments
Post a Comment