<ItemsControl.Template>
<ControlTemplate TargetType="ItemsControl">
 <StackPanel Orientation="Horizontal">
 <ItemsPresenter/>
</StackPanel>
 </ControlTemplate>
 </ItemsControl.Template>

I think you need a template for the ItemsControl as well, you only have one
for the Item (which treats each item individually). That's for the
UserControl.

cheers,
Stephen

On Wed, Jul 23, 2008 at 3:20 PM, Damian Edwards <[EMAIL PROTECTED]>
wrote:

>  Your ItemsControl is laying them out vertically. Is there a property on
> it to change the layout? Otherwise you'll have to change the Layout template
> or similar of the ItemsControl to be a StackPanel (like you've done on the
> outside of it).
>
>
>
> Regards,
>
> *Damian Edwards
> *
> Microsoft MVP <http://mvp.support.microsoft.com/> | ASP/ASP.NET
>
> Readify | Senior Consultant
>
> M: 0448 545 868 | E: [EMAIL PROTECTED] | C:
> [EMAIL PROTECTED] | W: www.readify.net
>
>
>
> *From:* [EMAIL PROTECTED] [mailto:
> [EMAIL PROTECTED] *On Behalf Of *Philip Beadle
> *Sent:* Wednesday, 23 July 2008 17:10
>
> *To:* [email protected]
> *Subject:* RE: [OzSilverlight] How to nest items controls?
>
>
>
> Things are looking good now EXCEPT J The radio buttons are supposed to be
> Horizontal!!
>
>
>
>
>
> Here's the page.xaml
>
>     <Grid x:Name="LayoutRoot" Background="White">
>
>         <StackPanel>
>
>             <Button x:Name="GetData" Click="GetData_Click" Content="Get
> Virtues" />
>
>             <ScrollViewer Height="600">
>
>                 <StackPanel>
>
>                     <ItemsControl x:Name="VirtueList" ItemsSource="{
> Binding}">
>
>                         <ItemsControl.ItemTemplate>
>
>                             <DataTemplate>
>
>                                 <StackPanel Orientation="Horizontal">
>
>                                     <TextBlock Text="{Binding 
> VirtueName}"Width
> ="200"/>
>
>                                     <SkillsMatrix:VirtueCategoryControl x:
> Name="Virtuecategories" />
>
>                                 </StackPanel>
>
>                             </DataTemplate>
>
>                         </ItemsControl.ItemTemplate>
>
>                     </ItemsControl>
>
>                 </StackPanel>
>
>             </ScrollViewer>
>
>         </StackPanel>
>
>     </Grid>
>
>
>
> And the user control
>
>
>
>     <Grid x:Name="LayoutRoot" Background="White" >
>
>         <StackPanel Orientation="Horizontal">
>
>             <ItemsControl x:Name="CategoryList" ItemsSource="{Binding}">
>
>                 <ItemsControl.ItemTemplate>
>
>                     <DataTemplate>
>
>                         <RadioButton Checked="rad1_Checked" Content="{
> Binding VirtueCategoryName}" Tag="{Binding VirtueCategoryID}"/>
>
>                     </DataTemplate>
>
>                 </ItemsControl.ItemTemplate>
>
>             </ItemsControl>
>
>         </StackPanel>
>
>     </Grid>
>
>  What did I do wrong?
>
>
>
>
>
> Regards,
>
> *Philip Beadle*
> Readify | Principal Consultant
> Microsoft MVP - ASP/ASP.NET, MCAD
>
> Suite 206 Nolan Tower | 29 Rakaia Way | Docklands | VIC 3008 | Australia
> M: +61 417 301 024 | E: [EMAIL PROTECTED] | C:
> [EMAIL PROTECTED] | W: www.readify.net
>
>
>
> *From:* [EMAIL PROTECTED] [mailto:
> [EMAIL PROTECTED] *On Behalf Of *Scott Barnes
> *Sent:* Wednesday, July 23, 2008 3:39 PM
> *To:* [email protected]
> *Subject:* RE: [OzSilverlight] How to nest items controls?
>
>
>
> Looking forward to reading the post. If you have any feedback or
> suggestions etc,  as per usual my inbox is always open and as there is
> always room for improvement! J
>
>
>
>
>
> *From:* [EMAIL PROTECTED] [mailto:
> [EMAIL PROTECTED] *On Behalf Of *Philip Beadle
> *Sent:* Tuesday, 22 July 2008 9:53 PM
> *To:* [email protected]
> *Subject:* RE: [OzSilverlight] How to nest items controls?
>
>
>
> I made a User Control and used a static List in the app class which it is
> bound to.  Works ok but its a little slow.
>
>
>
> Im going to put together a post on SL + ADO.Net Data Services + Entity
> Framework once I get this all sorted out.
>
>
>
> Love this new tech stuff J
>
>
>
> Regards,
>
> *Philip Beadle*
> Readify | Principal Consultant
> Microsoft MVP - ASP/ASP.NET, MCAD
>
> Suite 206 Nolan Tower | 29 Rakaia Way | Docklands | VIC 3008 | Australia
> M: +61 417 301 024 | E: [EMAIL PROTECTED] | C:
> [EMAIL PROTECTED] | W: www.readify.net
>
>
>
> *From:* [EMAIL PROTECTED] [mailto:
> [EMAIL PROTECTED] *On Behalf Of *Scott Barnes
> *Sent:* Wednesday, July 23, 2008 2:49 PM
> *To:* [email protected]
> *Subject:* RE: [OzSilverlight] How to nest items controls?
>
>
>
> +1 agreed.
>
>
>
> It's also advisable to use a singleton pattern here as well, in that you
> have one Model in which your controls feed from. In that each row below can
> feed from one property with Binding capabilities built in. In that the
> ModelState may have a dictionary of Items within them, each of those item is
> effectively a ValueObject. The ValueObject has Notification events built
> within, which will allow you to adjust the data from the ModelState (via
> other access points) and the view in turn will be self contained.
>
>
>
> More to the point, the moment you make a UserControl, consider making it
> black boxed if you're not adhering to a home grown framework. The reason I
> suggest this, as it promotes reuse but at the same time you get into the
> habit of treating each view piece as a class and not so much a view with
> effects/buttons/controls.. (is-a vs. has-a hehe).
>
>
>
>
> http://blogs.msdn.com/msmossyblog/archive/2008/06/21/silverlight-how-to-bind-controls-to-your-own-custom-model.aspx
>
>
>
> Nikhil has a more in depth post here:
>
> http://www.nikhilk.net/Silverlight-ViewModel-Pattern.aspx
>
>
>
> *--*
>
> *Scott Barnes *
> (Rich Platform Product Manager)
>
> Microsoft Corp. <http://www.microsoft.com/> | *Blog:*
> http://blogs.msdn.com/msmossyblog | *Mobile:* 425-802-9503 (*New*!)
>
> *Twitter*: twitter.com/mossyblog | *MSN*: [EMAIL PROTECTED]
> *P **Please consider your environmental responsibility before printing
> this e-mail*
>
>
>
>
>
>
>
> *From:* [EMAIL PROTECTED] [mailto:
> [EMAIL PROTECTED] *On Behalf Of *Stephen Price
> *Sent:* Tuesday, 22 July 2008 5:38 PM
> *To:* [email protected]
> *Subject:* Re: [OzSilverlight] How to nest items controls?
>
>
>
> I was initially thinking you'd use a converter but it might be easier to
> put the radio buttons into a user control or custom control. Put a DP on the
> user control to bind your value to. The list would bind to your value and
> the control figures out what to do with the value you give it. Changing the
> radio buttons would change the value in the public dependency property of
> the control which is bound to your list so it will be two way.
>
> HTH,
> Stephen
>
> On Wed, Jul 23, 2008 at 7:51 AM, Philip Beadle <[EMAIL PROTECTED]>
> wrote:
>
> Hi All,
>
>
>
> I want to build a list of items that each  need to show what category they
> are in like this
>
>
>
>
>
> My issue is I want the list of radio buttons to be bound as well so when i
> add a new one it shows up.  Any ideas on how to do this?
>
>
>
> Cheers
>
>
>
> Regards,
>
> *Philip Beadle*
> Readify | Principal Consultant
> Microsoft MVP - ASP/ASP.NET, MCAD
>
> [image: cid:[email protected]]
>
> Suite 206 Nolan Tower | 29 Rakaia Way | Docklands | VIC 3008 | Australia
> M: +61 417 301 024 | E: [EMAIL PROTECTED] | C:
> [EMAIL PROTECTED] | W: www.readify.net
>  ------------------------------
>
> The content of this e-mail, including any attachments is a confidential
> communication between Readify Pty Ltd and the intended addressee and is for
> the sole use of that intended addressee. If you are not the intended
> addressee, any use, interference with, disclosure or copying of this
> material is unauthorized and prohibited. If you have received this e-mail in
> error please contact the sender immediately and then delete the message and
> any attachment(s).
>
> *P** **Please consider your environmental responsibility before printing
> this e-mail*
>
>
>
> -------------------------------------------------------------------
> OzSilverlight.com - to unsubscribe from this list, send a message back to
> the list with 'unsubscribe' as the subject.
> Powered by mailenable.com - List managed by www.readify.net
>
>
>
> -------------------------------------------------------------------
> OzSilverlight.com - to unsubscribe from this list, send a message back to
> the list with 'unsubscribe' as the subject.
> Powered by mailenable.com - List managed by www.readify.net
>
> -------------------------------------------------------------------
> OzSilverlight.com - to unsubscribe from this list, send a message back to
> the list with 'unsubscribe' as the subject.
> Powered by mailenable.com - List managed by www.readify.net
>
> -------------------------------------------------------------------
> OzSilverlight.com - to unsubscribe from this list, send a message back to
> the list with 'unsubscribe' as the subject.
> Powered by mailenable.com - List managed by www.readify.net
>
> -------------------------------------------------------------------
> OzSilverlight.com - to unsubscribe from this list, send a message back to
> the list with 'unsubscribe' as the subject.
> Powered by mailenable.com - List managed by www.readify.net
>
> -------------------------------------------------------------------
> OzSilverlight.com - to unsubscribe from this list, send a message back to
> the list with 'unsubscribe' as the subject.
> Powered by mailenable.com - List managed by www.readify.net
>  -------------------------------------------------------------------
> OzSilverlight.com - to unsubscribe from this list, send a message back to
> the list with 'unsubscribe' as the subject.
> Powered by mailenable.com - List managed by www.readify.net
>



------------------------------------------------------------------- 
OzSilverlight.com - to unsubscribe from this list, send a message back to the 
list with 'unsubscribe' as the subject.
Powered by mailenable.com - List managed by www.readify.net

Reply via email to