<igDP:TextField Name="SKU" Label="Product SKU" IsReadOnly="True" />
This topic describes how to disable a particular field’s cells and how to set a field to be read-only in the xamDataPresenter™ controls.
The following topics are prerequisites to understanding this topic:
This topic contains the following sections:
In some cases, you may want to prevent the user from editing Field
data through the UI in the xamDataPresenter controls. In order to do that, set the Field IsReadOnly
property to true
.
Note that, you still can modify the editor’s value through code.
The default value of the IsReadOnly
property is null
which resolves to false.
The following table maps the desired configuration to the property settings that manage it.
Following is the code that implements this example.
In XAML:
<igDP:TextField Name="SKU" Label="Product SKU" IsReadOnly="True" />
You can disable a Field
’s cells in the xamDataPresenter controls.
The following table maps the desired configuration to the property settings that manage it.
Following is the code that implements this example.
In XAML:
<igDP:TextField Name="ProductID" Label="ID" IsEnabled=" IsEnabledInAddRecord=" />
You can enable or disable a specific Cell
in the xamDataPresenter controls to override the setting on its associated Field
.
The following table maps the desired configuration to the property settings that manage it.
Following is the code that implements this example.
In C#:
void XDG1_InitializeRecord(object sender, InitializeRecordEventArgs e)
{
var dr = e.Record as DataRecord;
if (dr != null)
{
dr.Cells["SKU"].IsEnabled = false;
dr.Cells["ProductID"].IsEnabled = true;
}
}
The following topics provide additional information related to this topic.