Where are the Update/Cancel buttons?

D

David Hallaran

Hi all!

I have a treeview. (Irrelevant).

In the target page I have a DataGrid populated with several data Items (a
SQL SP resultset as a DataTable.) and columns with Edit and Delete html
buttons.

There is a button outside of the grid labeled Add.

The Add button's purpose is to Clear() the DataTable which is the grid's
DataSource. After the clear() the Add function then adds a row to the
DataTable using DataTable.NewRow() followed by DataTable.InsertAt(). Then a
DataGrid.DataBind().

Sure enough the grid is cleared, the added DataGrid Item appears. The intent
is to allow the user fill in the new row and continue to add as necessary.

The problem: There is no Edit button, only Delete.

What am I doing wrong?

Thanks.
 
U

Uri

Hi David,

Maybe you need to set the grid's EditItemIndex to point to the Item to be
edited?

Regards,
urig
 
D

David Hallaran

urig,

Thank you. I left that out of my post. I did. The record is added at the top
of the DataTable and EditemIndex was set. The grid would come up in Edit
mode. Just no Edit button in the EditCommndColumn.

But I fixed it today: new project, new DataGrid. Pasted in the relevant code
behind as described below. Voila!!!

I've heard of all sorts of 'bugs' with the DataGrid.
 

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top