有时不会出现“保存文件”对话框

时间:2019-02-11 07:19:14

标签: c# winforms

我正在开发带有用于列表视图的保存文件对话框的导出功能,当列表视图的行太多,超过7000或更多时,保存文件对话框不显示不知道为什么!

更新:添加了代码段,如何填充列表视图!

这是我用于导出列表视图的代码,

+---------------------------+--------------------------+---------------------------+
|encounter_id               |date                      | encounters_in_past_30_days|
+---------------------------+--------------------------+---------------------------+
|random_id34234             |2018-09-17 21:53:08.999999| 2                         |
|this_can_be_anything2432432|2018-09-18 18:37:57.000000| 3                         |
|423432                     |2018-09-11 21:00:36.000000| 1                         |
+---------------------------+--------------------------+---------------------------+

这是我填写列表视图的方式:

private void ExportBTN_Click(object sender, EventArgs e)
{
    DialogResult dialogeResult = sfd.ShowDialog();
    if (dialogeResult == DialogResult.OK)
    {
        using ( var tw = new StreamWriter(sfd.FileName))
        {
            foreach (ListViewItem item in URLListView.Items)
            {
                tw.WriteLine(item.Text);
            }

            tw.Close();
            XtraMessageBox.Show("All links has been exported successfully.");
            AddLog("All links has been exported successfully.");

        }
    }
}

0 个答案:

没有答案