Hi All
I have an issue with binding of a control which is inside header of a RadGridView which is in an Expander where Expander.IsExpanded
=False
When I set IsExpanded=True, binding to checkbox starts working as normal.
As a workaround I did this in code behind ..
Private Sub CheckBox_OnLoaded(ByVal sender As Object, ByVal e As RoutedEventArgs)
Dim chk As CheckBox = sender
chk.DataContext = DataContext
Dim b As Binding = New Binding("MyProperty")
chk.SetBinding(CheckBox.IsCheckedProperty, b)
End Sub
This works, but I don't want to do this as its not great coding practice and any I will have to repeat this like 1000s time that I don't wanna do..
please tell me what options do I have here.
Thanks
M.
I have an issue with binding of a control which is inside header of a RadGridView which is in an Expander where Expander.IsExpanded
=False
<
telerik:GridViewDataColumn.Header
>
<
CheckBox
IsChecked
=
"{Binding DataContext.MyProperty, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
/>
</
telerik:GridViewDataColumn.Header
>
When I set IsExpanded=True, binding to checkbox starts working as normal.
As a workaround I did this in code behind ..
Private Sub CheckBox_OnLoaded(ByVal sender As Object, ByVal e As RoutedEventArgs)
Dim chk As CheckBox = sender
chk.DataContext = DataContext
Dim b As Binding = New Binding("MyProperty")
chk.SetBinding(CheckBox.IsCheckedProperty, b)
End Sub
This works, but I don't want to do this as its not great coding practice and any I will have to repeat this like 1000s time that I don't wanna do..
please tell me what options do I have here.
Thanks
M.