This question is locked. New answers and comments are not allowed.
I'm trying to dynamically update the Header of a DataField from code, but the UI won't update (other properties like Visibility do update the UI, though).
Here's a simplified version of my code so far:
Also, I've notice there is DataFile and DataFormField object: one has a Header and the other a LabelContent. Is there a way to work directly with the DataFormField in XAML?
Thanks.
Here's a simplified version of my code so far:
<
telerikInput:RadDataForm
x:Name
=
"radDataForm"
DataFieldValueChanged
=
"RadDataForm_OnDataFieldValueChanged"
>
<
telerikInput:DataField
TargetProperty
=
"Url"
Header
=
"Url (or IP)"
/>
</
telerikInput:RadDataForm
>
private
void
RadDataForm_OnDataFieldValueChanged(
object
sender, DataFieldValueChangedEventArgs e)
{
var dataForm = sender
as
RadDataForm;
if
(dataForm ==
null
)
{
return
;
}
var urlField = dataForm.FindFieldByPropertyName(
"Url"
).AssociatedDataField;
if
(urlField !=
null
)
{
// NOTE: this won't update the UI
urlField.Header =
"IP (or Host) *"
;
//// NOTE: this one DOES update the UI
//urlField.Visibility = Visibility.Collapsed;
}
}
Also, I've notice there is DataFile and DataFormField object: one has a Header and the other a LabelContent. Is there a way to work directly with the DataFormField in XAML?
Thanks.