Windows Develop Bookmark and Share   
 index > Windows Forms General > in datagrid when double clicked i want to open a new window to update that rows infos in my database
 

in datagrid when double clicked i want to open a new window to update that rows infos in my database

i have a datagridwiew to show stdno,name,surname,year,semester,1st exam,2nd exam,3rd exam,total grades,
name and surname are from stdinfos table and the rest are from the grades table
i have a form that shows them in that form another 2 tab to save new
1 tab for stdinfos other tab is for grades

what i want is when someone doubleclicked the stdid or something in that row a new window pop up(it can be a new win form) and the user can modify the student infos and grades from that window.
Benedict Von Richten  Friday, September 04, 2009 11:42 AM
Hello,

You can try using the CellContentDoubleClick event or CellMouseDoubleClick event to catch the event when user double clicks the row in your datagridview and then read the values from datagridview.SelectedRow or SelectedCell properties.
U can also let the datagridview editable and after all the modification are done oyu cand AppendChanges of your dataset to the database


with respect
Metin
Metin Gemil
Metin Gemil  Friday, September 04, 2009 1:46 PM

Please refer to the following thread:

http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/9ad17149-68d9-413a-8237-8266b010e7a6

When userID cell click, pass the current cell or row to the form2. Show form2. You can select the data from datasource or show the information of selected row. When finish edit, update the data to the datasource.

If anything unclear, please feel free to tell me.

Best regards,

Ling Wang


Please remember to click “Mark as Answer�on the post that helps you, and to click “Unmark as Answer�if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Ling Wang  Friday, September 11, 2009 8:13 AM

If your requirement is to edit the grid dataand save/update the same in database, please check the code(in the below link)which will edit the text in other window and save it in db when you selectany grid cell to edit.

http://www.codeproject.com/KB/vb/DataGridViewEditForm.aspx
Rohini Chavakula  Friday, September 11, 2009 12:05 PM
Hello,

You can try using the CellContentDoubleClick event or CellMouseDoubleClick event to catch the event when user double clicks the row in your datagridview and then read the values from datagridview.SelectedRow or SelectedCell properties.
U can also let the datagridview editable and after all the modification are done oyu cand AppendChanges of your dataset to the database


with respect
Metin
Metin Gemil
Metin Gemil  Friday, September 04, 2009 1:46 PM
can u give some code examples?
by the way are you somehow turk?
Benedict Von Richten  Friday, September 04, 2009 2:16 PM

Please refer to the following thread:

http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/9ad17149-68d9-413a-8237-8266b010e7a6

When userID cell click, pass the current cell or row to the form2. Show form2. You can select the data from datasource or show the information of selected row. When finish edit, update the data to the datasource.

If anything unclear, please feel free to tell me.

Best regards,

Ling Wang


Please remember to click “Mark as Answer�on the post that helps you, and to click “Unmark as Answer�if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Ling Wang  Friday, September 11, 2009 8:13 AM

If your requirement is to edit the grid dataand save/update the same in database, please check the code(in the below link)which will edit the text in other window and save it in db when you selectany grid cell to edit.

http://www.codeproject.com/KB/vb/DataGridViewEditForm.aspx
Rohini Chavakula  Friday, September 11, 2009 12:05 PM

You can use google to search for other answers

Custom Search

More Threads

• Visual Studio custom control designer events. How to enforce a single instance of a control on a page?
• Region.Union doesn't work properly, anyway to workaround?
• Control to display html ???
• Breaking taskbar's auto-hide
• Restart WebBrowser or MSHTML objects in order to apply browser's setting changes
• while writing a csv file from application, not able to write the zero padded numbers to file.
• How to set that a Control Resizes in Width only?
• How to get info on Website form Win Application?!
• TreeView Node Editing
• how to alter key values in app.config from code view