Button binding get value

3 posts, 0 answers
  1. Leex Lee
    Leex Lee avatar
    4 posts
    Member since:
    May 2010

    Posted 24 Dec 2010 Link to this post

    Hi;
    i can fill radbook pages from with webservice but
    How can i get binding value for each page. My codes bleow..
    ....
    ..........................
    ..................................

    <

     

     

    DataTemplate x:Key="RightPageTemplate">

     

     

     

     

    <Border BorderBrush="Gray" BorderThickness="1">

     

     

     

     

    <Grid Background="White">

     

     

     

     

    <Grid.RowDefinitions>

     

     

     

     

    <RowDefinition Height="Auto" />

     

     

     

     

    <RowDefinition Height="*" />

     

     

     

     

    <RowDefinition Height="Auto" />

     

     

     

     

    </Grid.RowDefinitions>

     

     

     

     

    <Border Background="LightGray" Opacity="0.5" BorderThickness="0 0 0 1"

     

     

     

    BorderBrush="Gray">

     

     

     

     

    <TextBlock Text="Right" HorizontalAlignment="Center"

     

     

     

    FontSize="20" FontWeight="Bold" TextWrapping="Wrap" />

     

     

     

     

    </Border>

     

     

     

     

    <Image Source="{Binding MediaPictures}" HorizontalAlignment="Center"

     

     

     

    VerticalAlignment="Center" Grid.Row="1" />

    '------------------------------------------------------------------------------------------------------

     

     

     

     

    <Button Content="{Binding MedyaSubgroup}" x:Name="BtnDocument" HorizontalAlignment="Center" Grid.Row="2" Click="Description_Click"

    '-------------------------------------------------------------------------------------------------------

     

     

     

    VerticalAlignment="Top" FontSize="20" FontWeight="Bold"

     

     

     

    />

     

     

     

     

    </Grid>

     

     

     

     

    </Border>

     

     

     

     

    </DataTemplate>

     

    ........................
    .................................

    <

     

     

    telerik:RadBook x:Name="RadBook1" IsKeyboardNavigationEnabled="True"

     

     

     

    LeftPageTemplate="{StaticResource LeftPageTemplate}"

     

     

     

    RightPageTemplate="{StaticResource RightPageTemplate}" Width="835" Height="408" />

     


    Code behind;

     

     

    Private Sub Description_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs)

     

    MessageBox

     

     

    .Show(DirectCast(RadBook1.????????, Medyalar).MedyaGroup).ToString()

     


    End Sub

    Ofcourse other event ok. load and others..

    But i cant get value each record??

    Sorry my poor English..

  2. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 29 Dec 2010 Link to this post

    Hello Leex Lee,

    You can get each pages bound value using the Button's DataContext property:
    MessageBox.Show(TryCast(TryCast(sender, Button).DataContext, Medyalar).MedyaGroup.ToString())
    Give this a try and let us know if this is what you had in mind.

    Greetings,
    Tina Stancheva
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
  3. DevCraft banner
  4. Leex Lee
    Leex Lee avatar
    4 posts
    Member since:
    May 2010

    Posted 07 Jan 2011 Link to this post

    Thank you Tina;

    Great working..
Back to Top