All Products
Demos
Pricing
Services
Blogs
Docs & Support
Search
Shopping cart
Login
Contact Us
Get A Free Trial
close mobile menu
Telerik Forums
/
UI for Silverlight Forum
/
Window
/
Window + DataBinding + ItemsControl
Cancel
Telerik UI for Silverlight
Resources
Buy
Try
Feed for this thread
3 posts, 0 answers
Mark
12 posts
Member since:
May 2009
Posted 17 Sep 2009
Link to this post
My requirements are to have a dashboard like experience utilizing windows so that users can move these windows around the screen as they see fit.
The setup is very MVVM... instead of adding windows through code I have been trying to utilize an items control bound to my list of "windows". This items controls' generated item template is a RadWindow.
1. The windows never appear.
2. If I call 'Show' in the windows loaded event I get an exception stating that the window can have only one parent.
3. I know the test case is sound as when I utilize a simple stack panel in the item template all is well.
question... is Window + DataBinding + ItemsControl possible?
Thanks!
Kaloyan
Admin
920 posts
Posted 23 Sep 2009
Link to this post
Hello Mark,
Could you please share some code with us so that we can try to reproduce the problem and resolve it? I tried the code snippet bellow and it seemed to be working fine.
<
ItemsControl x:
Name
=
"itemsControl"
>
<
ItemsControl.ItemTemplate
>
<
DataTemplate
>
<
StackPanel
>
<
telerikNavigation:RadWindow
Loaded
=
"RadWindow_Loaded"
>
<
Button
Content
=
"some content"
Width
=
"100"
Height
=
"25"
/>
</
telerikNavigation:RadWindow
>
</
StackPanel
>
</
DataTemplate
>
</
ItemsControl.ItemTemplate
>
</
ItemsControl
>
private
void
RadWindow_Loaded(
object
sender, System.Windows.RoutedEventArgs e)
{
var window = sender
as
RadWindow;
window.Show();
}
What am I missing?
Kind regards,
Kaloyan
the Telerik team
Instantly find answers to your questions on the new
Telerik Support Portal
.
Watch a
video
on how to optimize your support resource searches and
check out more tips
on the blogs.
Mark
12 posts
Member since:
May 2009
Posted 23 Sep 2009
Link to this post
Interesting... not sure if it was the solution but having wrapped the window in a stackpanel is what fixes the issue. (a hint from you example).
works now!
Back to Top
Close