如何使用Windows窗体在datagridview中显示计数 [英] How to display the count in datagridview using windows forms

查看:78
本文介绍了如何使用Windows窗体在datagridview中显示计数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

In my application i am displaying the messages if file is uploaded successfully and at the same time i am displaying the message that it is not uploaded in a message box the problem is i need to click ok button in message box each and every time when the message occours suppose if 40 files are not inserted i need to click ok button for 40 times i need to display the files which are inserted and which are not inserted at  a time in a datagridview.how can i do this.


                                   if (ErrorMessage == 0)
                                    {
                                        Ffname += path + "-" + "Uploaded successfully" + "\n";
                                    }
                                    else
                                    {
                                        NotInsFiles += path + " - " + "Not Inserted" + "\n";
                                    }
                                    lbluplodedfile.Text = TabNotIns;
                                    if (Ffname != null || Ffname != "")
                                    {
                                    MessageBox.Show(Ffname);
                                    lbluplodedfile.Text = Ffname;
                                    }
                                    else
                                    {
                                    MessageBox.Show(NotInsFiles);
                                    }





我的尝试:





What I have tried:

my above code displays the inserted and not inserted files in message box but i need to show all of them in datagridview that too at last how can i do this

推荐答案

也许这会有所帮助:我们如何从SQL数据表中获取数据总和并在datagridview中向人员显示总和值 [ ^ ]
Maybe this will be of help: How can we do sum of data from SQL data table and display the sum value to the person in datagridview[^]


您应在处理所有文件结束时在gridview中加载摘要。



声明一个包含所需列的数据表,并通过将值插入数据表替换消息框代码并在gridview中显示相同的内容。
You shall load the summary in the gridview at the end of processing all files.

declare a datatable with required columns and replace the messagebox code by inserting the values to the datatable and display the same in gridview.


这篇关于如何使用Windows窗体在datagridview中显示计数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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