ASP.NET GridView Control basic question

J

Johnny Jörgensen

This is probably a stupid question, but I've never used the ASP.NET GridView
control before, so I hope you'll bear with me and give me a clue.

I've got a Gridview on my webform to show the contents of a database table.
It's configured to show both "edit" "delete" and "insert" options in the
commandfield.

That's all well and fine, the edit and delete options work as they're
supposed to, but I simply don't understand the insert row functionality.
First of all: When I start out, my table is empty. That means that instead
of rows, the EmptyDataText is show, and thus no "insert" button is shown in
the grid. How do I go about inserting the first row?

Second: When my table DOES contain data, all three options are shown, but
the Insert option doesn't do anything. Are there other properties I have to
set or other considerations I have to make than just set the CommandFields
ShowInsertButton property to true?

Cheers,
Johnny J.
 
J

Johnny Jörgensen

OK, I spend all day yesterday trying to figure out why it didn't work. At
last I went out and bought myself a book about databinding in ASP.NET - and
there I learned that it isn't possible at all inserting rows in the GridView
control - you have to use the DetailsView control for that.

Stupid me, I assumed that the Web GridView worked like the Winforms
DataGridView control...

However, it would have save me a lot of time plus 100 bucks if somebody
could just have told me right off that it wasn't possible.

/Johnny
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top