I can see you are using the click event for the checkbox here:
<checkbox x:name="chkSelectAll" click="chk_Click" ischecked="True">
Margin="2,0,0,0" Content="Select" VerticalAlignment="Center" HorizontalAlignment="Left"/>
The click event will provide the sender of the event which in this case is a CheckBox.
private void chkSelectAll_Click(object sender, RoutedEventArgs e)
{
CheckBox myCheckBox = (CheckBox)sender;
ClickedCB = myCheckBox;
}
Update :
Arun wrote :
Thank you Tarun.K.S for your reply. This is working fine for me no issues. But I have another button. On the click event of that button I want access the above mentioned checkBox. How it is possible....???
How about storing the checkbox in a property.
Define a property :
private CheckBox _checkBox;
public CheckBox ClickedCB
{
get { return _checkBox; }
set { _checkBox=value; }
}
private void Button1_Click(Object sender, RoutedEventArgs e)
{
if(ClickedCB!=null)
{
}
}
This should do it!