Click here to Skip to main content
15,894,405 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: control is not accessible in code behind Pin
manognya kota6-Jan-12 0:07
manognya kota6-Jan-12 0:07 
QuestionParse string not working Pin
Dammie25-Jan-12 2:29
Dammie25-Jan-12 2:29 
AnswerRe: Parse string not working Pin
Pete O'Hanlon5-Jan-12 2:48
mvePete O'Hanlon5-Jan-12 2:48 
QuestionWPF ListBox With Radio Buttons Pin
Kevin Marois4-Jan-12 18:33
professionalKevin Marois4-Jan-12 18:33 
AnswerRe: WPF ListBox With Radio Buttons Pin
SledgeHammer015-Jan-12 5:01
SledgeHammer015-Jan-12 5:01 
GeneralRe: WPF ListBox With Radio Buttons Pin
Kevin Marois5-Jan-12 5:39
professionalKevin Marois5-Jan-12 5:39 
GeneralRe: WPF ListBox With Radio Buttons Pin
SledgeHammer015-Jan-12 6:37
SledgeHammer015-Jan-12 6:37 
GeneralRe: WPF ListBox With Radio Buttons Pin
Kevin Marois5-Jan-12 7:26
professionalKevin Marois5-Jan-12 7:26 
Ok, I understand your solution.

My data models are very simple:

public class PartDescriptionUpdateModel
{
    public string PartNo { get; set; }
    public string Description { get; set; }
    public List<PartDescriptionModel> Descriptions { get; set; }
}


and

public class PartDescriptionModel
{
    public Inventory InventoryLocation { get; set; }
    public string PartDescription { get; set; }
    public string ImageName { get; set; }
}



I now have this:

<Window.Resources>

    <HierarchicalDataTemplate DataType="{x:Type model:PartDescriptionUpdateModel}"
								ItemsSource="{Binding Path=Descriptions}">

        <StackPanel Orientation="Vertical">
                
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="{Binding Path=PartNo}"/>
                <Label Content=" - "/>
                <TextBlock Text="{Binding Path=Description}"/>
            </StackPanel>
                
            <ItemsControl ItemsSource="{Binding Descriptions}"
                            Margin="10, 0, 0, 20">
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <RadioButton Content="{Binding PartDescription}"/>
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>
                
        </StackPanel>
            
    </HierarchicalDataTemplate>

</Window.Resources>


It produces this[^].

There are 2 problems:

1) There's only 1 radio button being displayed. There are 3 per part.
2) The same value is being displayed for all.

I'm sort of new to templating, but I'm guessing there's a binding problem? Anything look abvious to you?
Everything makes sense in someone's mind

GeneralRe: WPF ListBox With Radio Buttons Pin
SledgeHammer015-Jan-12 7:54
SledgeHammer015-Jan-12 7:54 
GeneralRe: WPF ListBox With Radio Buttons Pin
Kevin Marois5-Jan-12 8:09
professionalKevin Marois5-Jan-12 8:09 
GeneralRe: WPF ListBox With Radio Buttons Pin
SledgeHammer015-Jan-12 8:16
SledgeHammer015-Jan-12 8:16 
GeneralRe: WPF ListBox With Radio Buttons Pin
Kevin Marois5-Jan-12 8:18
professionalKevin Marois5-Jan-12 8:18 
GeneralRe: WPF ListBox With Radio Buttons Pin
Kevin Marois5-Jan-12 8:22
professionalKevin Marois5-Jan-12 8:22 
GeneralRe: WPF ListBox With Radio Buttons Pin
SledgeHammer015-Jan-12 8:30
SledgeHammer015-Jan-12 8:30 
GeneralRe: WPF ListBox With Radio Buttons Pin
Kevin Marois5-Jan-12 11:09
professionalKevin Marois5-Jan-12 11:09 
GeneralRe: WPF ListBox With Radio Buttons Pin
SledgeHammer015-Jan-12 11:18
SledgeHammer015-Jan-12 11:18 
GeneralRe: WPF ListBox With Radio Buttons Pin
Kevin Marois5-Jan-12 11:34
professionalKevin Marois5-Jan-12 11:34 
QuestionListbox / Button Text update Pin
Member 84777754-Jan-12 12:05
Member 84777754-Jan-12 12:05 
AnswerRe: Listbox / Button Text update Pin
SledgeHammer014-Jan-12 12:35
SledgeHammer014-Jan-12 12:35 
GeneralRe: Listbox / Button Text update Pin
Member 84777754-Jan-12 12:40
Member 84777754-Jan-12 12:40 
GeneralRe: Listbox / Button Text update Pin
SledgeHammer014-Jan-12 13:36
SledgeHammer014-Jan-12 13:36 
GeneralRe: Listbox / Button Text update Pin
Member 84777754-Jan-12 13:40
Member 84777754-Jan-12 13:40 
GeneralRe: Listbox / Button Text update Pin
SledgeHammer014-Jan-12 14:45
SledgeHammer014-Jan-12 14:45 
QuestionDrawing semitransparent rectangle Pin
Member 29654714-Jan-12 11:40
Member 29654714-Jan-12 11:40 
QuestionFlat toggle button in Silverlight 4 Pin
AChatelain4-Jan-12 11:05
AChatelain4-Jan-12 11:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.