473,396 Members | 2,099 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Edit,AddNew and Delete Records in DataGrid

Hi All

I am new with Windows form. i am working on c#.net 2003. i have no idea how am i suppose to Edit, AddNew or Delete Record in DataGrid. I am passing a Dataset to my Grid. I want to modify,addnew and delete records in Grid. I know it must be very simple and easy, but i have no idea i have been searching and i am not able to find any proper solution. Any help would be really appreciated..Plz help me out guys.

Madhu
Jun 4 '07 #1
2 2036
Frinavale
9,735 Expert Mod 8TB
Hi All

I am new with Windows form. i am working on c#.net 2003. i have no idea how am i suppose to Edit, AddNew or Delete Record in DataGrid. I am passing a Dataset to my Grid. I want to modify,addnew and delete records in Grid. I know it must be very simple and easy, but i have no idea i have been searching and i am not able to find any proper solution. Any help would be really appreciated..Plz help me out guys.

Madhu
You will have to implement the function that handles the RowEditing event, and the function that handles the RowUpdating event.

You'll have to add a column that allows the user to start editing...

What have you tried so far?
Jun 4 '07 #2
You will have to implement the function that handles the RowEditing event, and the function that handles the RowUpdating event.

You'll have to add a column that allows the user to start editing...

What have you tried so far?
Hi Frin

Thanks for your reply. Well in Web forms, generally you write the code behind the designer..that is in HTML, you give the name of the function for EditEvent and DeleteEvents, we can generally even add Link button in ItemTemplate and its much more flexible..Here firstly you cannot write behind the code that the HTML side. Then i see many codes online...which almost is like 6 to 7 methods and i dont know how much lines code they are. I am just surprised for just to make an Edit or Delete ..i have to write like 100 lines code? i see here they are using DataGridTableStyle, DataGridcolumStyles,DataTable,DataRow. I am just really surprised and trying to find out..isnt there any simple way with 10 - 20 lines of code that can provide me these functions? Please post the code if you have any for normal Edit and Addnew Functions. I know its very weird ,coz i am asking something in very much general here.. But i would really appreciate if you could post a normal Grid have DataSet and simply these function are performed.

Thanks for your respone.

Madhu
Jun 4 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Aaron Ackerman | last post by:
I am using typed datasets in an N-Tier Windows app using VB.NET. I know this posting cannot be fully explained in a single post that is why I am asking for someone to point me to a real world...
25
by: dixie | last post by:
I have some code that adds new records into a table for each ID in a list box when a button on a form is clicked. This works fine. My problem now is that I wish to be able to edit all the records...
4
by: drakuu | last post by:
Hello there, I have DataGrid with some records and I would like to edit it right in the datagrid using the built in commands. I can't figure out a way to pass to the SQL query the record ID...
9
by: rn5a | last post by:
A Form has a DataGrid which displays records from a SQL Server 2005 DB table. Users can modify the records using this DataGrid for which I am using EditCommandColumn in the DataGrid. This is the...
9
bhcob1
by: bhcob1 | last post by:
Hey guys, 'Update or CancelUpdate without AddNew or Edit' On my database i keep occasionly get this error when i try and edit a field, it is not everytime. It will be working fine and then this...
1
by: teenagelcruise | last post by:
hi, i have a problem with my code which is i cannot update and addnew data into the database but i can delete the data.plz give me an idea.this is my code that i wrote. <html> <head> <meta...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.