This question is locked. New answers and comments are not allowed.
i want to create a ranking panel for a race , but when in first time i bind my collection to my radtileview it's work correctly , but after it , if i change one of the attributes , like name , position and etc , does not make any change in radtileview.
public
class
pool
{
public
string
_name;
public
string
name
{
get
{
return
_name;}
set
{ _name = value; }
}
public
int
_position;
public
int
position
{
get
{
return
_position; }
set
{ _position = value; }
}
}
public
partial
class
MainPage : UserControl
{
ObservableCollection<pool> p;
public
MainPage()
{
InitializeComponent();
p =
new
ObservableCollection<pool>();
for
(
int
i = 0; i < 100; i++)
{
pool pn =
new
pool();
pn.name =
"name: "
+ i.ToString();
p.Add(pn);
}
tile1.ItemsSource = p;
tile1.Height = 30 * 102;
p[2].position += 7;
}
private
void
Button_Click(
object
sender, System.Windows.RoutedEventArgs e)
{
p[2].position += 4;
}
}
<
UserControl
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
xmlns:mc
=
"http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable
=
"d"
x:Class
=
"SilverlightApplication1.MainPage"
xmlns:my
=
"clr-namespace:SilverlightApplication1"
Width
=
"640"
Height
=
"480"
>
<
UserControl.Resources
>
<
my:posconvert
x:Key
=
"posconvert"
/>
<
telerik:ContainerBindingCollection
x:Key
=
"ContainerBindings"
>
<
telerik:ContainerBinding
PropertyName
=
"Position"
Binding
=
"{Binding position, Mode=TwoWay, Converter={StaticResource posconvert}}"
/>
</
telerik:ContainerBindingCollection
>
<
DataTemplate
x:Key
=
"pooldata"
telerik:ContainerBinding.ContainerBindings
=
"{StaticResource ContainerBindings}"
>
<
StackPanel
Orientation
=
"Horizontal"
>
<
TextBlock
Text
=
"#"
VerticalAlignment
=
"Center"
/>
<
TextBlock
Text
=
"{Binding position}"
VerticalAlignment
=
"Center"
/>
<
TextBlock
Text
=
"{Binding name}"
VerticalAlignment
=
"Center"
/>
</
StackPanel
>
</
DataTemplate
>
</
UserControl.Resources
>
<
Grid
x:Name
=
"LayoutRoot"
Background
=
"White"
>
<
ScrollViewer
VerticalScrollBarVisibility
=
"Visible"
Width
=
"504"
>
<
telerik:RadTileView
MaxColumns
=
"1"
ItemContainerStyle
=
"{StaticResource RadTileViewItemStyle1}"
Name
=
"tile1"
ItemTemplate
=
"{StaticResource pooldata}"
/>
</
ScrollViewer
>
<
Button
Content
=
"Button"
HorizontalAlignment
=
"Right"
Margin
=
"0,62,-7,0"
VerticalAlignment
=
"Top"
Width
=
"75"
Click
=
"Button_Click"
/>
</
Grid
>
</
UserControl
>