This question is locked. New answers and comments are not allowed.
Hi,
I am using an expander as a listbox item, and it is all working well, except when expanding mutiple items and then scrolling the listbox using the vertical scrollbar. When more than one item is expanded, when you scroll down it seems like other listbox items further down in the list are also being expanded, randomly.
The real example has images etc.. in the expander content, but a much simplified xaml and code-behind snippet below also shows the problem I am having:
If you run the above example, and expand any two items (other than the very top two for some reason), and then scroll with the scrollbar, items further down in the list will be expanded also.
We're using the Silverlight 4 tools, Q1 SP1 release.
Any pointers you could give on the above, as to whether this is a bug, or I'm templating the data incorrectly or whatever, and any workarounds, would be great.
Thanks,
Colin Cowie.
I am using an expander as a listbox item, and it is all working well, except when expanding mutiple items and then scrolling the listbox using the vertical scrollbar. When more than one item is expanded, when you scroll down it seems like other listbox items further down in the list are also being expanded, randomly.
The real example has images etc.. in the expander content, but a much simplified xaml and code-behind snippet below also shows the problem I am having:
<Grid x:Name="LayoutRoot" Width="96" Height="900" HorizontalAlignment="Left" VerticalAlignment="Top" > |
<ListBox x:Name="ListBox1" Height="400" Width="Auto" |
HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Disabled"> |
<ListBox.ItemTemplate> |
<DataTemplate> |
<telerik:RadExpander Header="{Binding HeaderText}" Content="{Binding ContentText}" HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch"> |
</telerik:RadExpander> |
</DataTemplate> |
</ListBox.ItemTemplate> |
</ListBox> |
</Grid> |
public class MyObj |
{ |
public string HeaderText {get; set;} |
public string ContentText {get; set;} |
} |
public partial class MainPage : UserControl |
{ |
public ObservableCollection<MyObj> MyList; |
public MainPage() |
{ |
InitializeComponent(); |
MyList = new ObservableCollection<MyObj>(); |
for (var i = 0 ; i < 100; i++) |
{ |
MyList.Add(new MyObj() {HeaderText = i.ToString(), ContentText = i.ToString()}); |
} |
ListBox1.ItemsSource = MyList; |
} |
} |
If you run the above example, and expand any two items (other than the very top two for some reason), and then scroll with the scrollbar, items further down in the list will be expanded also.
We're using the Silverlight 4 tools, Q1 SP1 release.
Any pointers you could give on the above, as to whether this is a bug, or I'm templating the data incorrectly or whatever, and any workarounds, would be great.
Thanks,
Colin Cowie.