Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Setting a datagrid column's ReadOnly property to a binding

$
0
0

Hi everyone I binded my ID to a datagrid. And what I want is for it to not be editable but when adding a new row for the user to be able to write it in.

So what I did was create a bool parameter isEditable and set it to true by default but false when reading from database.

The problem is for some reason this doesn't work with a text column (it works with a combobox for some reason). Am I missing something? Here is the code

<DataGridTextColumn   Header="ID" Binding="{Binding Key.Id}" IsReadOnly="{Binding IsEditable}" />


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>