Click here to Skip to main content
15,882,114 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I want to perform CRUD operation within datagrid of winforms just like I do it in ASP.Net Gridview. But When I saw the events I just could not understand which one to use and how.
Can any one get me a good link for CRUD using winforms datagrid?. Or a hint on flow of events.
For example I need to insert when a row is left(another one created or row leave etc) or something like that.
I need all the operations inside grid,no form.
I tried searching but approximately all of the results are using a separate form for insertion.I need the insert part first.

I think you are getting my point otherwise I'll try to rephrase my question.
Thank You.
Posted
Comments
CHill60 26-Mar-15 7:54am    
This CP article (with demo code) might get you started ADO.NET for the Object-Oriented Programmer – Part Two[^]
Manvendra Singh 27-Mar-15 0:17am    
Thank you Chill60. I am going through it. By the way I am doing insertion of row on rowleave. Is it a good idea?
CHill60 27-Mar-15 5:33am    
I personally prefer my Users to have to take a specific action (e.g. a save button), but then I rarely trust my users ;-) I have seen commercial software save data on rowleave so it's ok to do that too.
Manvendra Singh 27-Mar-15 3:59am    
Now got another problem. I set a cell with autocomplete. Now row leave is firing even when I am selecting an item from that autocomplete. I don't want that. How to stop it. Any suggestions?

To me datagridview in winforms looks like a road full of potholes . You come out from one and fall into another:-)
CHill60 27-Mar-15 5:36am    
Not sure about this one - I'll have a play around when I get an opportunity - In the meantime have a look at the validation properties to see if anything springs out.
As per my previous comment - I tend to have a form-style of input so rarely use DataGridViews for input. Might be old-fashioned but I don't hit these sorts of problems ;-)

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