Intersoft.Client.UI.Data Namespace > UXGridView Class : IsReadOnlyBinding Property |
<CategoryAttribute("Common Properties")> Public Property IsReadOnlyBinding As Binding
Dim instance As UXGridView Dim value As Binding instance.IsReadOnlyBinding = value value = instance.IsReadOnlyBinding
[CategoryAttribute("Common Properties")] public Binding IsReadOnlyBinding {get; set;}
[CategoryAttribute("Common Properties")] public: property Binding^ IsReadOnlyBinding { Binding^ get(); void set ( Binding^ value); }
You can specify whether a column is editable through the IsReadOnly property in UXGridViewColumn. In more advanced scenarios, you may also want to disable editing on certain columns based on the value of other columns. For examples, if a product has been discontinued, editing in all other columns should be disabled.
To enforce the read only setting to a certain row in this scenario, you can use the IsReadOnlyBinding that is available in both UXGridView and UXGridViewBoundColumn level. The IsReadOnlyBinding at UXGridView level is used to evaluate whether the user can edit the row, while the IsReadOnlyBinding at UXGridViewBoundColumn level is used to evaluate whether the user can edit the cell.
The following code shows how to implement the IsReadOnlyBinding to achieve the above scenario.
XAML |
Copy Code
|
---|---|
<Intersoft:UXGridView IsReadOnlyBinding="{Binding Discontinued}"> <Intersoft:UXGridView.Columns> <Intersoft:UXGridViewCheckBoxColumn Header="Discontinued" Binding="{Binding Discontinued}"/> <Intersoft:UXGridViewTextColumn Header="Category ID" Binding="{Binding CategoryID}" IsReadOnlyBinding="{Binding Discontinued}"/> <Intersoft:UXGridViewTextColumn Header="Product ID" Binding="{Binding ProductID}" IsReadOnly="True" Aggregate="Count" FooterFormatString="Count = {0}"/> <Intersoft:UXGridViewTextColumn Header="Product Name" Binding="{Binding ProductName}"/> </Intersoft:UXGridView.Columns> </Intersoft:UXGridView> |
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2