DataBind

C

Calvin Lai

Hi all,

Say I have a DataTable object (oDT) resting on the ViewState object. And I
have a button called AddButton and a DataGrid, which its datasource is the
oDT.

If I want my app behaves so that whenever the user clicked the AddButton,
internally (server side) will add a row into the oDT and the DataGrid will
reflect such changes, AND, with that newly added row as editable.

I have tried many different ways but still no hope. Below is my code
snipplet.

AddButton_Click()
{
oDT.Rows.Add(oDT.NewRow());
oDG.Datasource = oDT;
oDG.DataBind();
oDG.EditeItemIndex = oDT.Rows.Count;
....
}

and it doesn't work...please help.

Calvin
 

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,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top