A
Assimalyst
Hi,
I have a datagrid DataBound with the following code:
private void SampleSearch()
{
// set search strings
int intUserNo = (int)(Session["usrNo"]);
string strPatientCode = patientCodeTxtBx.Text;
DateTime dateProcedureDate = DateTime.Parse(procedureDateTxtBx.Text);
// set parameter values
daSampleAss.SelectCommand.Parameters["@patientCode"].Value =
strPatientCode;
daSampleAss.SelectCommand.Parameters["@procedureDate"].Value =
dateProcedureDate;
daSampleAss.SelectCommand.Parameters["@usrNo"].Value = intUserNo;
daSampleAss.Fill(dsSampleAss1);
DataGrid1.DataBind();
}
Which works OK.
But when I click the 'Edit' link in the first column, the headers
remain but the row disappears. It's code is as follows:
private void DataGrid1_EditCommand(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
DataGrid1.EditItemIndex = e.Item.ItemIndex;
DataGrid1.DataBind();
}
DataGrid1 has DataSource = dsSampleAss1.
Any ideas?
Thanks.
I have a datagrid DataBound with the following code:
private void SampleSearch()
{
// set search strings
int intUserNo = (int)(Session["usrNo"]);
string strPatientCode = patientCodeTxtBx.Text;
DateTime dateProcedureDate = DateTime.Parse(procedureDateTxtBx.Text);
// set parameter values
daSampleAss.SelectCommand.Parameters["@patientCode"].Value =
strPatientCode;
daSampleAss.SelectCommand.Parameters["@procedureDate"].Value =
dateProcedureDate;
daSampleAss.SelectCommand.Parameters["@usrNo"].Value = intUserNo;
daSampleAss.Fill(dsSampleAss1);
DataGrid1.DataBind();
}
Which works OK.
But when I click the 'Edit' link in the first column, the headers
remain but the row disappears. It's code is as follows:
private void DataGrid1_EditCommand(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
DataGrid1.EditItemIndex = e.Item.ItemIndex;
DataGrid1.DataBind();
}
DataGrid1 has DataSource = dsSampleAss1.
Any ideas?
Thanks.