I'm binding a list of objects to a DataGrid programatically as follows:
gridAssetParameters.ItemsSource = asset.Parameters;
Parameters is a simple class with three properties: Name, Value, Description and Editable. The columns generate automatically when setting the source to asset.Parameters, however the problem that I'm facing is I cannot make a row readonly based on the property Editable. I was thinking of using the below event to manually make the rows readonly, however there is no way of looping through the generated rows or settings rows as readonly.
private void GridAssetParameters_AutoGeneratedColumns(object sender, EventArgs e)
{
//Somehow loop through rows and enable/disable based on logic
}
I am aware of MVVM however am unsure of how to use it in this case. Any advice will be appreciated!
UPDATE
Answer to my question was found here: