This is a migrated thread and some comments may be shown as answers.

Strange, too strange. Why ???

0 Answers 37 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Yostec
Top achievements
Rank 1
Yostec asked on 20 Aug 2012, 08:38 AM
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???    

        }
Tags
General Discussions
Asked by
Yostec
Top achievements
Rank 1
Share this question
or