Hello,
I derived the DataFormDataField class to return a RadMaskedNumericInput control. Three problems are readily apparent.
1. The DataMemberBinding does not propagate to the control from the DataFormDataField derivative.
2. The IsReadOnly property is not propagated to the control.
3. The Width property of the DataFormDataField class does not effect the Width of the control.
Here's the code...
You'll notice below, there is an extension to the DataFormDataField that sets the width of the label portion. Other than that, it is a standard DataFormDataField derivation.
Could you provide an example where these three issues are addressed?
Thanks in advance,
Steve
I derived the DataFormDataField class to return a RadMaskedNumericInput control. Three problems are readily apparent.
1. The DataMemberBinding does not propagate to the control from the DataFormDataField derivative.
2. The IsReadOnly property is not propagated to the control.
3. The Width property of the DataFormDataField class does not effect the Width of the control.
Here's the code...
/// <
summary
>
/// Numeric specific <
c
>DataFormDataField</
c
>.
/// </
summary
>
public class DataFormNumericField : DataFormDataField
{
/// <
summary
>
/// Returns a control to display and edit the underlying data.
/// </
summary
>
/// <
returns
><
c
>Control</
c
></
returns
>
protected override Control GetControl()
{
RadMaskedNumericInput ctrl = new RadMaskedNumericInput();
return ctrl;
}
}
You'll notice below, there is an extension to the DataFormDataField that sets the width of the label portion. Other than that, it is a standard DataFormDataField derivation.
<
amUI:DataFormNumericField
x:Name
=
"BatchNumberField"
DataMemberBinding="{Binding SelectedBatch.JournalEntryBatchNumber,
ValidatesOnDataErrors
=
True
,
ValidatesOnExceptions
=
True
,
NotifyOnValidationError
=
True
,
UpdateSourceTrigger
=
PropertyChanged
}"
Label
=
"{x:Static localProperties:Resources.Batch_Number}"
Width
=
"163"
amUI:DataFormColumn.LabelColumnWidth
=
"80"
IsReadOnly
=
"True"
>
<
amUI:DataFormNumericField.Resources
>
<
Style
TargetType
=
"telerik:RadMaskedNumericInput"
>
<
Setter
Property
=
"Placeholder"
Value
=
" "
/>
<
Setter
Property
=
"SelectionOnFocus"
Value
=
"SelectAll"
/>
<
Setter
Property
=
"IsClearButtonVisible"
Value
=
"False"
/>
<
Setter
Property
=
"AllowSkipPlaceholders"
Value
=
"False"
/>
<
Setter
Property
=
"AutoFillNumberGroupSeparators"
Value
=
"False"
/>
<
Setter
Property
=
"AutoFillZeros"
Value
=
"False"
/>
<
Setter
Property
=
"Mask"
Value
=
"#10"
/>
</
Style
>
</
amUI:DataFormNumericField.Resources
>
</
amUI:DataFormNumericField
>
Could you provide an example where these three issues are addressed?
Thanks in advance,
Steve