tags:

views:

1101

answers:

3

hi

i want to insert a new row to grid view while i click new button with out using the sqldatasource. and also how to edit, update, and delete rows from grid view. pls help me

[visual studio 2008 asp.net with c#]

thanks thiru

A: 

Good gridview tutorial : ASP.NET Quickstart Tutorials

Canavar
+1  A: 

What do you mean by "without using the SqlDataSource" ? How do you intend to propagate the inserted data to the data store, then ? You have not specified what other method you are using.

Anyway, the GridView does not inherently support insertion of records, but you can accomplish it by creating a FooterTemplate in which you create the fields for entry of new data. Additionally, provide a column to allow for Insert/Cancel buttons in the FooterTemplate.

Here's a good sample: How to easily insert row in GridView with SqlDataSource

Cerebrus
A: 

For adding new row you could try putting controls in footer row of the GridView.

Editing, updating and deleting require you to do two things:

  1. implement those operations in the SqlDataSource
  2. enable these operations in GridView
Migol