Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8756181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T14:00:53+00:00 2026-06-13T14:00:53+00:00

This has been asked before. I have tried several things and read a lot

  • 0

This has been asked before. I have tried several things and read a lot of posts but can’t get this working. What happens is the window opens and I don’t see columns in the listview. Instead I see System.Windows.Controls.Gridview Columns=3

The XAML and code-behind. I can post the ViewModel if necessary

XAML

<Window x:Class="DataBinding.LogFileWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:DataBinding"
        Title="LogFileWindow" Height="556.183" Width="717.987">
    <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
    <Grid>


                <TabPanel Margin="12,131,128.6,12.4" Width="Auto" Grid.RowSpan="2">
            <TabControl Margin="10,10,-270,-223.8">
                <TabItem Header="Logging Log">
                        <ListView Name="LoggingListView" ItemsSource="{Binding LogEntries}">
                            <GridView>
                                <GridViewColumn Header="Date" DisplayMemberBinding="{Binding Path=Date}"></GridViewColumn>
                                <GridViewColumn Header="Time" DisplayMemberBinding="{Binding Path=Time}"></GridViewColumn>
                                <GridViewColumn Header="Event" DisplayMemberBinding="{Binding Path=Event}"></GridViewColumn>
                            </GridView>
                        </ListView>
                </TabItem>
                <TabItem Header="Accounting Log">
                    <ListView Name="AccountingListView" ItemsSource="{Binding}" Margin="0,0,-14.6,38.2"></ListView>
                </TabItem>
                <TabItem Header="NVRAM Log">
                    <ListView Name="NVRAMListView" ItemsSource="{Binding}"></ListView>
                </TabItem>
            </TabControl>
        </TabPanel>

    </Grid>

C#

     public MainWindow()
        {   
            //create a new logging log file
            LoggingLog logfile = new LoggingLog();

            //add some entries
            // these are not real dates and times but that doesn't matter much.


            for (int i = 0; i < 20; i++)
            {
                LogFileEntry le = new LogFileEntry();
                le.Date = String.Format("Date{0}", i);
                le.Time = String.Format("Time{0}", i);
                le.Event = String.Format("Event{0}", i);
              logfile.LogEntryList.Add(le);
            }

            //now load the viewmodel

            LogViewModel logviewmodel = new LogViewModel();
            foreach (LogFileEntry le in logfile.LogEntryList)
            {
                logviewmodel.Add(new LogEntryViewModel(le));

            }

            //now set the datacontext on the window
            LogFileWindow lfwindow = new LogFileWindow();
            lfwindow.LogEntries = logviewmodel;
            lfwindow.LoggingListView.DataContext = logviewmodel;

            InitializeComponent();
            lfwindow.Show();
        }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T14:00:54+00:00Added an answer on June 13, 2026 at 2:00 pm

    Your XAML above inserts the GridView object as the content of the ListView. So it overrides the ItemsSource. you want to assign the GridView as the View of the ListView:

    <ListView Name="LoggingListView" ItemsSource="{Binding LogEntries}">
        <ListView.View>
            <GridView>
               <GridViewColumn Header="Date" DisplayMemberBinding="{Binding Path=Date}"></GridViewColumn>
               <GridViewColumn Header="Time" DisplayMemberBinding="{Binding Path=Time}"></GridViewColumn>
               <GridViewColumn Header="Event" DisplayMemberBinding="{Binding Path=Event}"></GridViewColumn>
             </GridView>
        </ListView.View>
    </ListView>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am aware that this question has been asked before, but I have tried
I know this question has been asked before, but I tried eveything and can't
Sorry if this has been asked before but I've tried searching and can't find
I know this has been asked before, but I just can't seem to get
I know this Question has been asked several times before, and I have tried
I know this question has been asked before, but I have tried the given
This has / may have been asked before, but, as far as I remember,
I'm sure this has been asked before, but I can't seem to find it
I apologise if this has been asked before but I can't find the info
I know this has probably been asked before but I can't find a specific

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.