Click here to Skip to main content

Silverlight / WPF

 
AnswerRe: Trying to set focus on DataGrid with DataGridTemplateColumn Pinmemberabollmeyer24-Sep-12 15:13 
QuestionOn ContextMenu MouseLeave PinmemberKenneth Haugland21-Sep-12 4:46 
AnswerRe: On ContextMenu MouseLeave PinmemberKenneth Haugland21-Sep-12 14:42 
QuestionWPF DataGrid Not SHowing Any Data PinmemberKevin Marois20-Sep-12 12:30 
When I set AutoGenerateColumns = false, then I see no data. I see the data when AutoGenerateColumns = True. Here's my grid:
 
<DataGrid Grid.Row="1"
            Grid.Column="0"
            Grid.ColumnSpan="2"
            Margin="5"
            ItemsSource="{Binding AccountItems}"
            SelectedItem="{Binding SelectedAccountItem}"
            AutoGenerateColumns="True">
    <DataGrid.Columns>
        <DataGridTemplateColumn Header="Date" 
                                Width="SizeToCells" 
                                IsReadOnly="True">
            <DataGridTemplateColumn.CellTemplate>
                <DataTemplate>
                    <Image Source="{Binding DisplayDate}" />
                </DataTemplate>
            </DataGridTemplateColumn.CellTemplate>
        </DataGridTemplateColumn>
        <DataGridTemplateColumn Header="Memo 1" 
                                Width="SizeToCells" 
                                IsReadOnly="True">
            <DataGridTemplateColumn.CellTemplate>
                <DataTemplate>
                    <Image Source="{Binding Memo1}" />
                </DataTemplate>
            </DataGridTemplateColumn.CellTemplate>
        </DataGridTemplateColumn>
 
        <DataGridTemplateColumn Header="Memo 2" 
                                Width="SizeToCells" 
                                IsReadOnly="True">
            <DataGridTemplateColumn.CellTemplate>
                <DataTemplate>
                    <Image Source="{Binding Memo2}" />
                </DataTemplate>
            </DataGridTemplateColumn.CellTemplate>
        </DataGridTemplateColumn>
        <DataGridTemplateColumn Header="Debit" 
                                Width="SizeToCells" 
                                IsReadOnly="True">
            <DataGridTemplateColumn.CellTemplate>
                <DataTemplate>
                    <Image Source="{Binding Debit}" />
                </DataTemplate>
            </DataGridTemplateColumn.CellTemplate>
        </DataGridTemplateColumn>
        <DataGridTemplateColumn Header="Credit" 
                                Width="SizeToCells" 
                                IsReadOnly="True">
            <DataGridTemplateColumn.CellTemplate>
                <DataTemplate>
                    <Image Source="{Binding Credit}" />
                </DataTemplate>
            </DataGridTemplateColumn.CellTemplate>
        </DataGridTemplateColumn>
        <DataGridTemplateColumn Header="Balance" 
                                Width="SizeToCells" 
                                IsReadOnly="True">
            <DataGridTemplateColumn.CellTemplate>
                <DataTemplate>
                    <Image Source="{Binding Balance}" />
                </DataTemplate>
            </DataGridTemplateColumn.CellTemplate>
        </DataGridTemplateColumn>
    </DataGrid.Columns>
</DataGrid>
 
What am I doing wrong here?
 
Thanks
If it's not broken, fix it until it is

AnswerRe: WPF DataGrid Not SHowing Any Data [modified] PinmemberKenneth Haugland20-Sep-12 12:47 
GeneralRe: WPF DataGrid Not SHowing Any Data PinprotectorPete O'Hanlon20-Sep-12 12:59 
GeneralRe: WPF DataGrid Not SHowing Any Data PinmemberKenneth Haugland20-Sep-12 13:10 
AnswerRe: WPF DataGrid Not SHowing Any Data PinprotectorPete O'Hanlon20-Sep-12 13:01 
GeneralRe: WPF DataGrid Not SHowing Any Data PinmemberKevin Marois20-Sep-12 14:23 
GeneralRe: WPF DataGrid Not SHowing Any Data PinprotectorPete O'Hanlon20-Sep-12 14:58 

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

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


Advertise | Privacy | Mobile
Web04 | 2.8.150327.1 | Last Updated 27 Mar 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid