DataGrid

S

SSP

Dear .NETters,

I am unable to get the _UpdateCommand event to fire on one of my web forms.

The Update Linkbutton has the following URL linked to it...

javascript:{if (typeof(Page_ClientValidate) != 'function' ||
Page_ClientValidate()) __doPostBack('DataGrid1$_ctl13$_ctl2','')}

Following is the _UpdateCommand code...

||||||||||||

private void DataGrid1_UpdateCommand(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
string key = DataGrid1.DataKeys[e.Item.ItemIndex].ToString();
string NewUName, NewUserEmail;
TextBox tbox;
tbox= (TextBox) e.Item.Cells[0].Controls[0];
NewUName = tb.Text;
tbox = (TextBox) e.Item.Cells[1].Controls[0];
NewUserEmail = tbox.Text;

TableCell UNameCell = e.Item.Cells[0];
TableCell UserEmailCell = e.Item.Cells[1];
TextBox UNameBox = (TextBox)UNameCell.Controls[0];
TextBox UserEmailBox = (TextBox)UserEmailCell.Controls[1];

string UName = System.String.Format(UNameBox.Text);
string UserEmail = System.String.Format(UserEmailBox.Text);

oleDbUpdateCommand1.Parameters["UserEmail"].Value = UserEmail;
oleDbUpdateCommand1.Parameters["UName"].Value = UName;

oleDbConnection1.Open();
oleDbDataAdapter1.Update(dsTeamMembers1);
oleDbConnection1.Close();

DataGrid1.EditItemIndex = -1;
DataGrid1.DataBind();
}

||||||||||||

Any clues?

SSP
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top