引用DetailsView的一个单元格
protected void DetailsView1_DataBound(object sender, EventArgs e)
{
if (DetailsView1.CurrentMode == DetailsViewMode.Insert)
{
TextBox stateTextBox = (TextBox)DetailsView1.Rows[6].Cells[1].Controls[0];
stateTextBox.Text = DropDownList1.SelectedValue;
stateTextBox.Enabled = false;
}
}
{
if (DetailsView1.CurrentMode == DetailsViewMode.Insert)
{
TextBox stateTextBox = (TextBox)DetailsView1.Rows[6].Cells[1].Controls[0];
stateTextBox.Text = DropDownList1.SelectedValue;
stateTextBox.Enabled = false;
}
}