private void checkboxHeader_CheckedChanged(object sender, EventArgs e) { if (!NeedCheckAll) { return; } DateTime CurrentDate = Security.GetCurrentDate(); StoreDG.CellValueChanged -= StoreDG_CellValueChanged; for (int i = 0; i < StoreDG.RowCount; i++) { int StoreID = Convert.ToInt32(StoreDG["StoreID", i].Value); int CurrentCount = Convert.ToInt32(StoreDG["CurrentCount", i].Value); bool EditEnd = ((ComponentFactory.Krypton.Toolkit.KryptonCheckBox)StoreDG.Controls.Find("checkboxHeader", true)[0]).Checked; StoreDG["EditEnd", i].Value = EditEnd; if (EditEnd) { InventoryManager.AddInventoryDetail(CurrentDate, InventoryManager.CurrentInventoryID, StoreID, CurrentCount, CurrentCount, Security.CurrentUserID, string.Empty); InventoryManager.ChangeCurrentFields(CurrentCount, string.Empty); } else { InventoryManager.UnConfirmInventoryDetail(InventoryManager.CurrentInventoryID, StoreID); } InventoryManager.InventaryEndEdit(EditEnd); } StoreDG.EndEdit(); StoreDG.CellValueChanged += StoreDG_CellValueChanged; }
private void checkboxHeader_CheckedChanged(object sender, EventArgs e) { if (!NeedCheckAll) { return; } for (int i = 0; i < StoreDG.RowCount; i++) { int StoreID = Convert.ToInt32(StoreDG["ReadyStoreID", i].Value); StoreDG["EditEnd", i].Value = ((ComponentFactory.Krypton.Toolkit.KryptonCheckBox)StoreDG.Controls.Find("checkboxHeader", true)[0]).Checked; } StoreDG.EndEdit(); }