May 08
Scott Mitchell has what is probably the smoothest solution for the GridView which works for the DetailsView just the same:
- Put a DetailsView into the EmptyDataTemplate of the “parent DetailsView”
- Bind it to the same datasource as the parent
- Set the DefaultMode of the child to “Insert”
Alternatively, you can put a Button into the EmptyDataTemplate and define the click event handler as follows:
protected void Button1_Click(object sender, EventArgs e)
{
DetailsView1.ChangeMode(DetailsViewMode.Insert);
}
Recent Comments