Hello friends
In this example, we will see how to “Edit, Update and Delete GridView Using BoundField”
In this example, I am using Employee Table
In this example, we will see how to “Edit, Update and Delete GridView Using BoundField”
In this example, I am using Employee Table
Table script:
Source Code:
C# Code:
GridView1_RowEditing: Event Will Send the selected row in Edit Mode Using
GridView1.EditIndex=e.NewEditIndex
GridView1.EditIndex=e.NewEditIndex
And Again call the data() method
Once you click on Edit Button Dynamic textbox will generate for Each Column.
GridView1_RowUpdating: Event Will get all textbox values and update that
record in the database
GridView1_RowUpdating: Event Will get all textbox values and update that
record in the database
(1) (2) (3)
GridView1.Rows[e.RowIndex].Cells[2].Controls[0]
(1) e.rowsIndex will give currently selected row no
(2) It will Get the Selected Row cell number 2
(3) In that cell select 1st control that is textbox
Like this, u will get all textbox values then just Concatenate those values In
Update Query.
Change Some text & click on Update button
Primary key column and while updating you need one Unique Column That’s
why I made EmployeeId Column as Readonly(see in above image Employee Id
is Read Only).
Update Query.
Change Some text & click on Update button
GridView1_RowCreated: Event Will fire for Each row which is going to bind
with gridview. In this Event, I’m Making EmpId column as a Read Only
because EmpId is a
with gridview. In this Event, I’m Making EmpId column as a Read Only
because EmpId is a
Primary key column and while updating you need one Unique Column That’s
why I made EmployeeId Column as Readonly(see in above image Employee Id
is Read Only).
GridView1_RowCancelingEdit: Event will Cancel the Currently Edited Row
For canceling Current Operation just make GridView EditIndex to -1 and
call data() method.
GridView1_RowDeleting: Event Will fire when you click on Delete button.
Once you click on delete button it will get currently selected row and
raise this event.
call data() method.
GridView1_RowDeleting: Event Will fire when you click on Delete button.
Once you click on delete button it will get currently selected row and
raise this event.
For deleting a record we need to get the EmpId id of that record.
int Id =int.Parse(GridView1.Rows[e.RowIndex].Cells[1].Text);
Note: There are two ways of Editing and Updating Gridview rows.
In this article I explained it using BoundField In my Next Article I will show How to Edit Update GridView Using TemplateField. There are several ways for getting those dynamically generated textbox values we use that in different scenarios. If u have any queries regarding Grid View Post your comment or send mail on ranjeetpatil4545@gmail.com
In this article I explained it using BoundField In my Next Article I will show How to Edit Update GridView Using TemplateField. There are several ways for getting those dynamically generated textbox values we use that in different scenarios. If u have any queries regarding Grid View Post your comment or send mail on ranjeetpatil4545@gmail.com
Thank you
Thank you Very much....
ReplyDelete-
shivmidhin
thank you for sharing
ReplyDeleteWebsite Development in india
its really good........
ReplyDeleteThank you
if i want to insert the data into a Boundfield
ReplyDeletethen how can i will insert ???
More about....Asp.Net Gridview
ReplyDeleteLing
it's working thanx
ReplyDeleteI am really happy with your blog because your article is very unique and powerful for new reader.
ReplyDeleteselenium training in chennai
Really very nice blog information for this one and more technical skills are improve,i like that kind of post.
ReplyDeleterpa Training in tambaram
blueprism Training in tambaram
automation anywhere training in tambaram
iot Training in tambaram
rpa training in sholinganallur
blue prism training in sholinganallur
automation anywhere training in sholinganallur
iot training in sholinganallur
Great post! I am actually getting ready to across this information, It’s very helpful for this blog.Also great with all of the valuable information you have Keep up the good work you are doing well.
Deleteautomation anywhere training in chennai
automation anywhere training in bangalore
automation anywhere training in pune
automation anywhere online training
blueprism online training
rpa Training in sholinganallur
rpa Training in annanagar
iot-training-in-chennai
blueprism-training-in-pune
automation-anywhere-training-in-pune
Nice tutorial. Thanks for sharing the valuable information. it’s really helpful. Who want to learn this blog most helpful. Keep sharing on updated tutorials…
ReplyDeleteData Science with Python training in chenni
Data Science training in chennai
Data science training in velachery
Data science training in tambaram
Data Science training in OMR
Data Science training in anna nagar
Data Science training in chennai
Data science training in Bangalore
It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me...
ReplyDeleteBlueprism training in Bangalore
Blueprism training in Pune
Blueprism training in Chennai
Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging.
ReplyDeleteangularjs
Training in chennai
angularjs-Training in chennai
angularjs Training in chennai
angularjs-Training in tambaram
angularjs-Training in sholinganallur
Hello, I read your blog occasionally, and I own a similar one, and I was just wondering if you get a lot of spam remarks? If so how do you stop it, any plugin or anything you can advise? I get so much lately it’s driving me insane, so any assistance is very much appreciated.
ReplyDeleteAndroid Training in Chennai | Best Android Training in Chennai
Matlab Training in Chennai | Best Matlab Training in Chennai
Best AWS Training in Chennai | AWS Training in Chennai
Selenium Training in Chennai | Best Selenium Training in chennai
Devops Course Training in Chennai | Best Devops Training in Chennai
Attend The Python training in bangalore From ExcelR. Practical Python training in bangalore Sessions With Assured Placement Support From Experienced Faculty. ExcelR Offers The Python training in bangalore.
ReplyDeletepython training in bangalore
Attend The Machine Learning Training in Bangalore From ExcelR. Practical Machine Learning Training in Bangalore Sessions With Assured Placement Support From Experienced Faculty. ExcelR Offers The Machine Learning Training in Bangalore.
ReplyDeleteExcelR Machine Learning Training in Bangalore
I can’t imagine that’s a great post. Thanks for sharing.
ReplyDeleteLearn Best Microstrategy Training in Bangalore from Experts. Softgen Infotech offers the Best RPA Training in Bangalore.100% Placement Assistance, Live Classroom Sessions, Only Technical Profiles, 24x7 Lab Infrastructure Support.
Positive site, where did u come up with the information on this posting?I have read a few of the articles on your website now, and I really like your style. Thanks a million and please keep up the effective work.
ReplyDeleteAWS training in chennai | AWS training in anna nagar | AWS training in omr | AWS training in porur | AWS training in tambaram | AWS training in velachery
ReplyDeleteThis looks absolutely perfect. All these tiny details are made with lot of background knowledge.
Salesforce Training | Online Course | Certification in chennai | Salesforce Training | Online Course | Certification in bangalore | Salesforce Training | Online Course | Certification in hyderabad | Salesforce Training | Online Course | Certification in pune
wonderful article. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article resolved my all queries.thanks
ReplyDeleteAi & Artificial Intelligence Course in Chennai
PHP Training in Chennai
Ethical Hacking Course in Chennai Blue Prism Training in Chennai
UiPath Training in Chennai
I feel very grateful that i read this.It is very helpful and very informative and i really learned a lot from it.
ReplyDeletelearn360digitmg artificial intelligence course
it's really cool blog. Linking is very useful thing.you have really helped
ReplyDelete360digitmg business analytics online course training
nice blog..
ReplyDelete360digitmg ai and machine learning courses
It's interesting that many of the bloggers to helped clarify a few things for me as well as giving.Most of ideas can be nice content.
ReplyDeleteThe people to give them a good shake to get your point and across the command.
Java training in Chennai
Java training in Bangalore
Java training in Hyderabad
Java Training in Coimbatore
Java Online Training
Great post. Thanks for sharing.....
ReplyDeleteAngularjs Training in Bangalore
Angularjs classes in Pune
Such a good post .thanks for sharing
ReplyDeleteIELTS Training in T Nagar
IELTS Training in T Nagar
Thank you for sharing such a nice and interesting blog and really very helpful article.
ReplyDeleteWant to become Oracle Recruiting Cloud Certified Specialist or Consultant? Attend this Best Oracle Recruiting Cloud Training course offered by the Unogeeks (Rated as Top Oracle Recruiting Cloud Training Institute in the market)
kralbet
ReplyDeletebetpark
tipobet
slot siteleri
kibris bahis siteleri
poker siteleri
bonus veren siteler
mobil ödeme bahis
betmatik
FW8
betmatik
ReplyDeletekralbet
betpark
mobil ödeme bahis
tipobet
slot siteleri
kibris bahis siteleri
poker siteleri
bonus veren siteler
N7HG3F
van
ReplyDeleteçekmeköy
kepez
manavgat
milas
H8F
fethiye
ReplyDeletekağıthane
kuşadası
maltepe
şirinevler
0XWUG
yurtdışı kargo
ReplyDeleteresimli magnet
instagram takipçi satın al
yurtdışı kargo
sms onay
dijital kartvizit
dijital kartvizit
https://nobetci-eczane.org/
3JL
salt likit
ReplyDeletesalt likit
KBU3