protected void btnAddStackCount_Click(object sender, EventArgs e) { StackCountDataEditor.IsNew = true; StackPhysicalCountInfo blankStack = inventoryService.GetBlankStackCount(physicalCountInformation); object oPreviousStack = StackCountDataEditor.DataSource; if (oPreviousStack != null) { blankStack.ShedId = ((StackPhysicalCountInfo)oPreviousStack).ShedId; blankStack.StackId = ((StackPhysicalCountInfo)oPreviousStack).StackId; } StackCountDataEditor.DataSource = blankStack; StackCountDataEditor.DataBind(); mpeStackCountDataEditorExtender.Show(); }