Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
260
Not able to access the control value - Null reference exception
posted

 

Hi,

I have created a silverlight page with xamoutlookbar which has the hierarchy like the following


xamoutlookbar
 group1
  datetime1Control
  datetime2Control
 group2
  CheckBox1Control
  CheckBox2Control
  RadioButton1Control
 group3
  Calendar1Control

 

But whenever I try to get the value of these controls, I am getting null reference exception.
For eg:-

I tried both the following codes

DateTime dTime = datetime1Control.SelectedDate.Value;
DatePicker dPicker1 = this.FindName("datetime1Control") as DatePicker;

 

Please help

Thanks
-Sajin