The text of this article is not in this database — only its details are. Read it on the old site: Edit, Delete, Update and Insert operations in a DataGrid: Part II
18 Comments
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment.

vasantha rPosted Jun 2, 2010, 5:43 AM
i want new row using gridview only..not in textbox
ashvin raviPosted May 13, 2010, 2:21 AM
suppose i will update the fields based on the datatype nvarchar. how wil i modify the below code int U_ID = (int)gridedit.DataKeys[(int)e.Item.ItemIndex];
ssPosted Mar 14, 2010, 3:31 AM
hi how in insert you get id is it auto increment? you dont get it this code have error
raj mohanPosted Jun 25, 2009, 7:17 AM
Good explanation .Thank you www.rajmohan.co.nr
vinay kumarPosted Mar 14, 2008, 6:48 AM
hello sir, I vinaykumar visited ur site it is just fantastic i jst got lots of information i am very thankful to you . please can u help me. I need a run time project should be used ASp.net ,ado.net and some understandable c# because i am new to c#. onemore time thank u very much Thankyou with regards vinay email:[email protected]
laxman reddyPosted Sep 28, 2007, 10:48 PM
hai raahul nice rticle i have the like requirement here i am explainging i have to show an update button in each row of the datagrid and when ever use click the update button user can able to update the row here i know how to add update button in the data grid but idont know how to write code to function the update button please help me it is little bit urgent and i am a new comer thank u in advance
Chris GannPosted Sep 2, 2007, 1:50 PM
I get these errors when trying to edit or delete: Edit (after clicking 'Update') "Failed to convert parameter value from a Guid to a Int32. " Del (after clicking) "Specified cast is not valid. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. " Exception Details: System.InvalidCastException: Specified cast is not valid. Source Error: Line 88: { Line 89: con = new SqlConnection(ConfigurationSettings.AppSettings["connect"]); Line 90: int U_ID = (int)gridedit.DataKeys[(int)e.Item.ItemIndex]; Line 91: cmd.CommandText = " Delete from record where id=" + U_ID; Line 92: cmd.Connection = con;
sonia guptaPosted May 10, 2007, 1:18 AM
Hi , I m working on PDA aplication ,this is very new to me ,so if anyone knows about "How to add button and textbox in datagrid coloumn in .net compact framework" plz maiolas soon as possible
sonia guptaPosted May 10, 2007, 1:17 AM
pls u hv a solution then sen dme soon
NagarjunaReddy GandraPosted Apr 27, 2007, 7:04 AM
How to put dropdown list in data grid control in design mode