如何显示的时间记录在WPF ListView中的内容? [英] How to display the content of time log in the WPF ListView?

查看:415
本文介绍了如何显示的时间记录在WPF ListView中的内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找答案,但我还没有找到一个真正的。
我知道这个逻辑,但我没有这个想法如何实现它。

I've been searching for answers but I haven't found one really. I know the logic but I just don't have the idea how to implement it.

这是我的时间日志:

No    Mchn  EnNo        Name        Mode    IOMd    DateTime    
00001   1   00001234                1   0   2004/01/01  01:01
00002   1   00001234                1   0   2015/05/12  04:01
00003   1   00001234                2   0   2015/05/12  04:01
00004   1   00001234                1   0   2004/01/01  01:01
00005   1   00001234                1   0   2015/05/13  10:42

和我想这个转换成一个列表视图。
真的需要你的帮助。

and I want to convert this into a listview. Really need your help.

推荐答案

下面是我的回答是:

namespace textfile
{
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        private void LoadButton(object sender, RoutedEventArgs e)
        {
            foreach (string line in File.ReadAllLines(@"GLG_001.TXT"))
            {
                var listViewItem = new ListViewItem();
                listViewItem.Content = line;

                ListView.Items.Add(listViewItem);
            }
        }
    }
}

这篇关于如何显示的时间记录在WPF ListView中的内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆