I have a situation:
DataGrid with TemplateColumn. Template contains Stack panel with CheckBox and TextBox. What I want is when I press CheckBox then TextBox which is on the same StakcPanel set value to 1.
So in simple
CheckBox -> IsChecked==true -> Set TextBox value to 1 (TextBox on the same StackPanel as CheckBox)
I try with RelativeSource but not work.
Thanks For help.
Well you can bind the Content of the TextBox TextForTextBox, and bind the Checked state to Checked. in your viewModel you would : do
This is assuming that you have a ViewModel that implements the INotfiyPropertyChanged.
EDIT
Code to change this in pure XAML :