Hi all, I need some help in data grid control. I have placed a datagrid control on the form. There are different fields along with them i have two buttons "Add New" and "Delete".
If I click "Add New" button, a row at the bottom should be created, can anyone tell me how to add row at the bottom of the grid. And after adding it should be editable also..
Also one question. I have added a datagrid buy giving datagrid.datasource=list, at runtime Im not able to edit the datagrid content. Is there any property to make the datagrid editable.
Im really new to .Net, I have come from C background.
Can anyone give me sample example so that I can get my stuff working..
Thanks in advance..
Loading
Sam HobbsPosted Mar 31, 2011, 5:13 PM
Also, it is requested that you use the appropriate forum. This question is about a DataGridView, correct? So it is very easy to put the question in the Windows Forms forum.
A DataGridView has a row at the bottom for creating a new row by default. Are you sure it is not there? If it is not there then perhaps you have the property set so that it is disabled. You don't have to have separate buttons to add and delete rows. You can do that but the DataGridView is designed so that you do not need to.
Yes, there are properties for making a DataGridView editable. Please look at the documentation.
Note that the easiest way to do this is to make a data source from the object, then add the data source to the form. By default, a DataGridView will be used for the data source. The VS IDE can make it amazingly easy. It will create the list for you.
Suthish NairPosted Mar 31, 2011, 3:21 PM
mahesh guptaPosted Mar 31, 2011, 11:37 AM
Mahesh ChandPosted Mar 31, 2011, 10:02 AM
Edit, Delete and Update in a DataGrid in Visual Web developer 2005
Insert, Update and Delete in Silverlight DataGrid using ADO.NET
Select, Add, Update, and Delete Data in a ASP.NET GridView Control
Embedded Datagrids with Add, Edit and Delete funtionality