ItemsControl question
Last post 04-17-2008 5:23 AM by gowhere. 5 replies.
Sort Posts:
03-28-2008 5:03 PM
ItemsControl question

I want to make a ItemsControl so I can put bound a list of items. I want items (say thumbmail image) display from left to right, then top and down. If the window resizes the number of items per row will automatically adjusted, something like the behavior in HTML when I set the style.float=left

 Anybody knows how I define the ItemsControl template to achieve this?  Thank!

Software Engineer
Aprimo, Inc

Please remember to mark the replies as answers if they answered your question

sladapter

Joined on 03-05-2008
Indiana, US
Posts 403
03-28-2008 6:56 PM
Marked as Answer
Re: ItemsControl question

Since there is no wrap panel built in, you can create your own, or find someone else's online, like here as a base:

http://www.codeproject.com/KB/silverlight/WrapPanelSilverlight.aspx

Then use that as your items panel in your ItemsControl.

Hope this helps.


Bill Reiss - Client App Dev MVP (What's an MVP?)
Silverlight and XNA Game Development Tutorials at http://www.bluerosegames.com/brg

Bill Reiss

Joined on 05-01-2007
Posts 469
03-28-2008 8:42 PM
Re: ItemsControl question

 Thanks Bill, that's exactly  what I want.

Software Engineer
Aprimo, Inc

Please remember to mark the replies as answers if they answered your question

sladapter

Joined on 03-05-2008
Indiana, US
Posts 403
04-16-2008 3:47 AM
Re: ItemsControl question

HI,I want to know how I can add the control to my VS toolbox,and while editing my xaml I can drag into my xaml,thanks

gowhere

Joined on 02-20-2008
Posts 2
04-16-2008 9:43 AM
Re: ItemsControl question

gowhere:

HI,I want to know how I can add the control to my VS toolbox,and while editing my xaml I can drag into my xaml,thanks

 

1) Add a new Tab "My Siverlight Controls" on the toolbox.

2) Right Click the new "My Siverlight Controls"  Tab click "choose items" to open "Choose Toolbox Items" window.

3) Click the Silverlight Tab. Click browse button to find your siliverlight project (or silverlight control library project) dll which contains the WrapPanel control. Click open. The controls of that project will be added to the list. You can select the WrapPanel to be added to the toolbox. Now you can drag the WrapPanel to your XAML.

 

 

 

 

Software Engineer
Aprimo, Inc

Please remember to mark the replies as answers if they answered your question

sladapter

Joined on 03-05-2008
Indiana, US
Posts 403
04-17-2008 5:23 AM
Re: ItemsControl question

sladapter:

gowhere:

HI,I want to know how I can add the control to my VS toolbox,and while editing my xaml I can drag into my xaml,thanks

 

1) Add a new Tab "My Siverlight Controls" on the toolbox.

2) Right Click the new "My Siverlight Controls"  Tab click "choose items" to open "Choose Toolbox Items" window.

3) Click the Silverlight Tab. Click browse button to find your siliverlight project (or silverlight control library project) dll which contains the WrapPanel control. Click open. The controls of that project will be added to the list. You can select the WrapPanel to be added to the toolbox. Now you can drag the WrapPanel to your XAML.

 

 

 

 

thanks for reply. I do it in your way before and it doesn't work,report an error with "there is no compenent to display..."

but in project use the .dll it works .

thanks

gowhere

Joined on 02-20-2008
Posts 2