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

Access the Selected Value

1 Answer 54 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Lisa
Top achievements
Rank 1
Lisa asked on 01 Aug 2011, 05:24 PM

I’m missing something I’m sure is simple – help please?

 

I have a RadDropDownButton that contains a TreeView.  It’s pretty straightforward, I just want them to select one value, no checkboxes or anything like that.  I cannot seem to figure out the syntax to get the selected item from the TreeView. 

 

Here is the XAML code that creates the user control:

 

<telerik:RadDropDownButton Content="Click to Select Charts" Click="RadDropDownButton_Click"
  
            <telerik:RadDropDownButton.Background
  
                <LinearGradientBrush
  
                    <GradientStop Color="#FFE6FFFF" Offset="0.028999984264373779" /> 
  
                    <GradientStop Color="#FFBDEBEF" Offset="1" /> 
  
                </LinearGradientBrush
  
            </telerik:RadDropDownButton.Background
  
            <telerik:RadDropDownButton.DropDownContent
  
                  
  
                <telerik:RadTreeView IsOptionElementsEnabled="False" IsTriStateMode="False" x:Name="tvStudentCharts"
  
                    <telerik:RadTreeViewItem x:Name="tviStudentChart"  Header="Available Charts" IsExpanded="True"
  
                                             ItemsSource="{Binding StudentChartsCategories}"
  
                                             ItemTemplate="{StaticResource StudentChartsCategoryTreeViewTemplate}">
  
                          
  
                    </telerik:RadTreeViewItem
  
                </telerik:RadTreeView
  
            </telerik:RadDropDownButton.DropDownContent
  
        </telerik:RadDropDownButton>

This is included on another page:

 

<local:ctrlCdbStudentChartSelection x:Name="Zone1Selection" Margin="6,25,6,2" Width="200" Height="30"  HorizontalAlignment="Left" Visibility="Collapsed"/>

I can see the value I want, but can’t seem to access it.  I’ve tried syntax like Zone1Selection.tvStudentCharts.SelectedValues, but that doesn’t get to the URL value I want.  What am I missing?

 

Attached is the watch showing what I’m trying to get to.

 

Thanks!

 

 

1 Answer, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 04 Aug 2011, 02:47 PM
Hi Lisa,

I attached a sample project in your support thread. Please have a look at it and let me know if it helps you in implementing your scenario.

Kind regards,
Tina Stancheva
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

Tags
TreeView
Asked by
Lisa
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Share this question
or