Export (0) Print
Expand All

DataGridColumn.IsReadOnly Property

Gets or sets a value that indicates whether cells in the column can be edited.

Namespace:  System.Windows.Controls
Assembly:  System.Windows.Controls.Data (in System.Windows.Controls.Data.dll)

public bool IsReadOnly { get; set; }
<sdk:dataGridColumn IsReadOnly="bool"/>

XAML Values

sdk:dataGridColumn

Typically, sdk:DataGridTextColumn, sdk:DataGridCheckBoxColumn, or sdk:DataGridTemplateColumn.

Property Value

Type: System.Boolean
true if cells in the column cannot be edited; otherwise, false. The default is false.

ExceptionCondition
InvalidOperationException

When setting this property to false on a column derived from DataGridBoundColumn, the column Binding property indicates a data source that is read-only.

-or-

When setting this property to true on a column with a cell that is in edit mode, the cell edit cannot be committed or reverted.

If the DataGridColumn.IsReadOnly property and the DataGrid.IsReadOnly property are both set, a value of true will take precedence over a value of false.

Silverlight

Supported in: 5, 4, 3

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show:
© 2014 Microsoft