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

Button binding get value

2 Answers 53 Views
Book
This is a migrated thread and some comments may be shown as answers.
Leex Lee
Top achievements
Rank 1
Leex Lee asked on 24 Dec 2010, 03:32 PM
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 Answers, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 29 Dec 2010, 01:38 PM
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
0
Leex Lee
Top achievements
Rank 1
answered on 07 Jan 2011, 12:12 PM
Thank you Tina;

Great working..
Tags
Book
Asked by
Leex Lee
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Leex Lee
Top achievements
Rank 1
Share this question
or