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

Acces controls inside DataBoundListBox...?!

2 Answers 65 Views
DataBoundListBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Xmenus
Top achievements
Rank 1
Xmenus asked on 28 May 2012, 02:55 PM
Hi all,

Can anyone explain how to access or get names of children inside DataBoundListBox..in this case names of TextBlock-s?!
Xaml is as follows.
One more question though it's not related to this but anyways it has to do with DataBoundListBox....
Check out here  VirtualizingDataCollection  When i debug i see that (startIndex=0) is always zero.Does it mean that it should be always zero?!

Thanks to all,
Regards

    <telerikPrimitives:RadDataBoundListBox.ItemTemplate>
        <DataTemplate>
            <Border Background="#FFE5FFCB"
                    BorderThickness="0.7"
                    BorderBrush="#FFD5E2D0">
                <StackPanel Name="mystack"
                            Width="480">
                    <!--<Border Background="#B4B900AF">-->
                    <TextBlock Name="txtName"
                               VerticalAlignment="Stretch"
                               FontSize="34"                                          
                               FontFamily="Fonts/customFont.ttf#customFont"
                               TextAlignment="Left"
                               TextWrapping="Wrap"
                               Text="{Binding
                    Path=FirstName}"
                               Foreground="#FF25334B"
                               Visibility="Visible"
                               HorizontalAlignment="Right"
                               Margin="8,1,12,0"
                               FontWeight="ExtraBold"
                               FontStretch="UltraCondensed" />
                    <!--</Border>-->
                    <!--<Border Background="#FF20BAE2">-->
                    <TextBlock Name="txtLastName"
                               FontSize="28"
                               TextWrapping="Wrap"
                               Foreground="#FF532372"
                               Text="{Binding Path=LastName}"
                               FontStretch="Condensed"
                               FontFamily="Portable User Interface"
                               Margin="8,1,8,0"
                               HorizontalAlignment="Left"
                               UseLayoutRounding="False" />
                    <!--</Border>-->
 
                </StackPanel>
            </Border>
        </DataTemplate>
    </telerikPrimitives:RadDataBoundListBox.ItemTemplate>


2 Answers, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 31 May 2012, 08:38 AM
Hi Xmenus,

You can use the VisualTreeHelper class to traverse the visual tree of any UIElement in Silverlight. Could you please share some further details why would you need to access elements within the visual tree?

As for the VirtualizingDataCollection question: the startIndex depends on the data currently loaded in the collection.

Kind regards,
Deyan
the Telerik team

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

0
Xmenus
Top achievements
Rank 1
answered on 02 Jun 2012, 09:57 PM
I solved the problem using VisualTreeHelper class...Thank you!
Regards
 
Tags
DataBoundListBox
Asked by
Xmenus
Top achievements
Rank 1
Answers by
Deyan
Telerik team
Xmenus
Top achievements
Rank 1
Share this question
or