Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi everybody!
I'm having a problem, I was looking on google but did not see his problem and decided on your website to seek help.
Specifically, my problem is as follows:
  1 - I have a datagridview that allows users to automatically add new lines, and receive data from the new line (this issue I have done and works very well).
  2 - when I export to excel conducted from the new line is added to the datasource of the datagridview I found to be null (The problem lies here).
People ask me, is when we add data directly on datagidview, the data will not be binding to the datasource? Is there any way so that when we add data directly on the datagridview, the data will be added to the datasource?
We hope to receive the help from everyone!
Thank you!
Posted
Comments
Sinisa Hajnal 29-Sep-14 6:36am    
Did you try Grid.CommitEdit? or DataTable.AcceptChanges? Look into those...
Nathan Minier 29-Sep-14 8:05am    
If you want it added automatically you need to make sure that AJAX is setup properly. Do you have a ScriptManager running on the page? Is your GridView in an UpdatePanel?

If you don't want to use AJAX, you will need to postback before changes will be applied to the database.
ChintanShukla 1-Oct-14 5:21am    
Can you pleas share your Code
[no name] 3-Oct-14 4:14am    
could you please post your code

1 solution

Hi EveryBody!
Thank you all very much!
Now I have found the solution to my problem.
I do not use the output data to excel from another datasource that will be used directly from the data row on the datagridview.
I would like to close this topic here.
 
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