This question is locked. New answers and comments are not allowed.
Hello,
I have several controls such as radio buttons within a DataTemplate I set as the EditTemplate of a RadDataForm as shown in the "Customized Fields" page code snippet. I'm trying to access the controls of that DataTemplate in code-behind in a similar way as it is supposed to be possible in a SL toolkit DataForm control:
public
MainPage()
{
InitializeComponent();
Loaded += MainPage_Loaded;
DataForm1.Loaded +=
new
RoutedEventHandler(DataForm1_Loaded);
}
void
DataForm1_Loaded(
object
sender, RoutedEventArgs e)
{
currentRadioButton = ((RadDataForm)sender).FindName(
"radioButtonCurrent"
)
as
RadioButton;
currentRadioButton.FontWeight = FontWeights.Bold;
}
I also tried by accessing the 'Resources' member:
currentRadioButton = ((RadDataForm)sender).Resources[
"radioButtonCurrent"
]
as
RadioButton;
but when the line where the font weight is changed is reached, I get an exception because currentRadioButton is always null. Is there any way to access the controls within a DataTemplate in code-behind to change dynamically their properties?
Thanks