This question is locked. New answers and comments are not allowed.
Hello All,
I have just started using Telerik Controls in my app. In RadDataBoundListBox, I have used RadImageButton with TextBlock inside ListBox. My Xaml code for it is,
Now If user selects the ImageButton, I want it to move to another RadDataBoundListBox ,"Favorites". So, I attempted to get the index of ImageButton clicked and move the corressponding Item in ItemSource to Favorites List. But I could not figure out the right method. I could get the TextBlock index as SelectedItem but not RadImageButton.
How to know the index of "ImageButton" currently clicked in ListBox. I do not have this ImageButton in my ViewModel or ItemModel. So, if I know the index of ImageButton clicked, I will use that to find corresponding ItemViewModel. Or Is there any Binding property to use with TextBlock?
Short Note : If "Favorite" image button is clicked, I want to move that ListItem to another ListBox.
Kindly Help me. Thank you.
I have just started using Telerik Controls in my app. In RadDataBoundListBox, I have used RadImageButton with TextBlock inside ListBox. My Xaml code for it is,
<
telerikPrimitives:RadDataBoundListBox
x:Name
=
"radDataBoundListBox"
ItemsSource
=
"{Binding Items}"
SelectionChanged
=
"MainListBox_SelectionChanged"
Background
=
"#FFA08888"
Margin
=
"0,0,13,6"
>
<
telerikPrimitives:RadDataBoundListBox.VirtualizationStrategyDefinition
>
<
telerikPrimitives:WrapVirtualizationStrategyDefinition
Orientation
=
"Horizontal"
/>
</
telerikPrimitives:RadDataBoundListBox.VirtualizationStrategyDefinition
>
<
telerikPrimitives:RadDataBoundListBox.ItemTemplate
>
<
DataTemplate
>
<
StackPanel
Margin
=
"0,0,0,17"
Width
=
"400"
Height
=
"70"
HorizontalAlignment
=
"Right"
Orientation
=
"Horizontal"
>
<
telerikPrimitives:RadImageButton
RestStateImageSource
=
"/Recipes;component/Images/bookmark1.png"
PressedStateImageSource
=
"Images/bookmark.png"
ButtonBehavior
=
"ToggleButton"
DisabledStateImageSource
=
"Images/star-none.png"
Click
=
"Favourite_Clicked"
DataContext
=
"{Binding}"
Name
=
"image"
Checked
=
"Favorite_Checked"
/>
<
TextBlock
Text
=
"{Binding LineOne}"
TextWrapping
=
"Wrap"
Margin
=
"12,-6,12,0"
Style
=
"{StaticResource PhoneTextSubtleStyle}"
FontSize
=
"40"
FontFamily
=
"Segoe WP Light"
Foreground
=
"Black"
/>
</
StackPanel
>
</
DataTemplate
>
</
telerikPrimitives:RadDataBoundListBox.ItemTemplate
>
</
telerikPrimitives:RadDataBoundListBox
>
Now If user selects the ImageButton, I want it to move to another RadDataBoundListBox ,"Favorites". So, I attempted to get the index of ImageButton clicked and move the corressponding Item in ItemSource to Favorites List. But I could not figure out the right method. I could get the TextBlock index as SelectedItem but not RadImageButton.
How to know the index of "ImageButton" currently clicked in ListBox. I do not have this ImageButton in my ViewModel or ItemModel. So, if I know the index of ImageButton clicked, I will use that to find corresponding ItemViewModel. Or Is there any Binding property to use with TextBlock?
Short Note : If "Favorite" image button is clicked, I want to move that ListItem to another ListBox.
Kindly Help me. Thank you.