Click here to Skip to main content
15,912,329 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
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
Posted
Updated 27-Jun-17 20:16pm

 
Share this answer
 
Comments
kav@94 27-Jun-17 6:12am    
my question is not about displaying the sum in datagridview it is about binding label messages to gridview
RickZeeland 27-Jun-17 12:26pm    
Then why was your question "How to display the count in datagridview" ?
Please change the question and be more clear.
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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900