Click here to Skip to main content
15,891,633 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Data Binding Problem Pin
#realJSOP23-Apr-09 10:21
mve#realJSOP23-Apr-09 10:21 
GeneralRe: Data Binding Problem Pin
Christian Graus23-Apr-09 10:50
protectorChristian Graus23-Apr-09 10:50 
GeneralRe: Data Binding Problem Pin
Mark Salsbery23-Apr-09 11:21
Mark Salsbery23-Apr-09 11:21 
GeneralRe: Data Binding Problem Pin
#realJSOP23-Apr-09 13:50
mve#realJSOP23-Apr-09 13:50 
GeneralRe: Data Binding Problem Pin
#realJSOP24-Apr-09 2:56
mve#realJSOP24-Apr-09 2:56 
GeneralRe: Data Binding Problem Pin
Mark Salsbery24-Apr-09 6:45
Mark Salsbery24-Apr-09 6:45 
GeneralRe: Data Binding Problem Pin
#realJSOP24-Apr-09 10:25
mve#realJSOP24-Apr-09 10:25 
GeneralRe: Data Binding Problem [modified] Pin
Mark Salsbery24-Apr-09 10:52
Mark Salsbery24-Apr-09 10:52 
Two different source collections?

If you want to keep the
m_workTrayData = new UDPWorkTrayItems();
this.listViewWorkTray.DataContext = m_workTrayData;

then the ItemsSource binding should be
<Setter Property="ItemsSource" Value="{Binding}" />

and m_workTrayData will be the collection bound to the ListView.

If you want to use the collection object defined in XAML ("WorkTrayData")
then your binding sould be fine, but WorkTrayData is the collection you want to
add objects to.

Here's a quick and dirty way to check if your ItemsSource is bound correctly
(note I used WindowTitle and WindowSource - adjust for actual property names) :
m_workTrayData = new UDPWorkTrayItems();
this.listViewWorkTray.DataContext = m_workTrayData;

    <Window.Resources>
        <Style TargetType="{x:Type ListView}" >
            <Setter Property="ItemsSource" Value="{Binding}" />
        </Style>
    </Window.Resources>
...
    <Grid>
        <ListView Name="listViewWorkTray">
            <ListView.View>
                <GridView>
                    <GridViewColumn Header="WindowTitle" Width="100" DisplayMemberBinding="{Binding Path=WindowTitle}"></GridViewColumn>
                    <GridViewColumn Header="WindowSource" Width="100" DisplayMemberBinding="{Binding Path=WindowSource}"></GridViewColumn>
                </GridView>
            </ListView.View>
        </ListView>
    </Grid>

That should show you if your collection is bound correctly.

Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

modified on Friday, April 24, 2009 4:59 PM

GeneralRe: Data Binding Problem Pin
#realJSOP25-Apr-09 2:52
mve#realJSOP25-Apr-09 2:52 
GeneralRe: Data Binding Problem Pin
Mark Salsbery25-Apr-09 6:58
Mark Salsbery25-Apr-09 6:58 
QuestionMaking a template for a ListView in WPF ? Pin
Mohammad Dayyan23-Apr-09 4:55
Mohammad Dayyan23-Apr-09 4:55 
QuestionRe: Making a template for a ListView in WPF ? Pin
Mark Salsbery23-Apr-09 7:04
Mark Salsbery23-Apr-09 7:04 
AnswerRe: Making a template for a ListView in WPF ? Pin
Mohammad Dayyan23-Apr-09 7:21
Mohammad Dayyan23-Apr-09 7:21 
GeneralRe: Making a template for a ListView in WPF ? Pin
Mark Salsbery23-Apr-09 7:55
Mark Salsbery23-Apr-09 7:55 
GeneralRe: Making a template for a ListView in WPF ? Pin
Mohammad Dayyan23-Apr-09 8:13
Mohammad Dayyan23-Apr-09 8:13 
GeneralRe: Making a template for a ListView in WPF ? Pin
Mark Salsbery23-Apr-09 8:29
Mark Salsbery23-Apr-09 8:29 
GeneralRe: Making a template for a ListView in WPF ? Pin
Mohammad Dayyan23-Apr-09 8:45
Mohammad Dayyan23-Apr-09 8:45 
Questionbinding problem Pin
spurnd22-Apr-09 21:48
spurnd22-Apr-09 21:48 
AnswerRe: binding problem Pin
Pete O'Hanlon23-Apr-09 0:28
mvePete O'Hanlon23-Apr-09 0:28 
GeneralRe: binding problem Pin
User 171649223-Apr-09 1:25
professionalUser 171649223-Apr-09 1:25 
GeneralRe: binding problem Pin
Pete O'Hanlon23-Apr-09 1:42
mvePete O'Hanlon23-Apr-09 1:42 
QuestionPrint Datatable Pin
Prajeesh22-Apr-09 19:06
Prajeesh22-Apr-09 19:06 
AnswerRe: Print Datatable Pin
Pete O'Hanlon23-Apr-09 22:17
mvePete O'Hanlon23-Apr-09 22:17 
QuestionWPF UserControl Library - I'm at a loss [modified] Pin
#realJSOP22-Apr-09 3:58
mve#realJSOP22-Apr-09 3:58 
AnswerRe: WPF UserControl Library - I'm at a loss Pin
barker77022-Apr-09 6:06
barker77022-Apr-09 6:06 

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.