Strange, too strange. Why ???

1 posts, 0 answers
  1. Yostec
    Yostec avatar
    19 posts
    Member since:
    Aug 2012

    Posted 20 Aug 2012 Link to this post

    In   the  behind  code  can't   obtain   the  "Content"     of   Shap   which  is  a  item  of    Diagram control .

    This    is   a   serious   problem  ,   indicating   that   the   "  not   will  object    reference    set    to     an    instance   of     an object.   "    error.

    XAML:
           <telerik:RadDiagramShape Geometry="{telerik:CommonShape ShapeType=RoundedRectangleShape}" 
                 x:Name="rd_SiPing" Width="100" Height="35"
                 Content="Harvard University"
                 Tag="A"
                 FontSize="14"
                 Position="193,120"
                 Background="LightGray"                      
                 MouseLeftButtonDown="rd_SiPing_MouseLeftButtonDown" >
                                
                </telerik:RadDiagramShape>


                 <telerik:RadDiagramShape Geometry="{telerik:CommonShape ShapeType=RoundedRectangleShape}" 
                 x:Name="rd_SiPingValue" Width="100" Height="25"
                 Content="1716.0kW"
                 Tag="A"
                 FontSize="12"
                 Position="193,160"
                 Background="LightGray"    
                />


    Code  behind:
            private void rd_SiPing_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
            {
                string str = rd_SiPingValue.Content.ToString();
                string strtwo = rd_Region.Content.ToString();
                string strthree = rd_SiPing.Tag.ToString();

              Question:   Three   lines   of   code   as   above    are   all   prompt     error:   "not   will  object    reference    set    to     an    instance   of     an object."
                Why???    

            }
Back to Top