void m_keyboardSpread_RowAdding(object sender, EventRowAdding e) { // ถ้าไม่มีการแก้ไข Row แต่ก่อนที่จะเพิ่มแถวใหม่ จะต้อง Validate แถวล่าสุด (ล่างสุด) ก่อน if (shtView.RowCount > 0 && shtView.ActiveRowIndex >= 0) { if (!ValidateRowSpread(shtView.RowCount - 1, true)) { e.Cancel = true; return; } } }
void m_keyboardSpread_RowAdding(object sender, EventRowAdding e) { //KeyboardSpread a = (KeyboardSpread)sender; //if (a.IsBinded) //{ // if (a.Owner == fpView) // { // int lastRowNonEmpty = shtView.GetLastNonEmptyRow(NonEmptyItemFlag.Data); // if (lastRowNonEmpty == shtView.RowCount - 1) // { // if ("".Equals(shtView.Cells[lastRowNonEmpty, (int)eColView.LOT_NO].Text) // ) // { // e.Cancel = true; // } // } // } //} }
void m_keyboardSpread_RowAdding(object sender, EventRowAdding e) { if (m_bRowHasModified) { // ถ้า Row กำลังแก้ไขอยู่ if (!ValidateRowSpread(shtView.ActiveRowIndex, false)) { e.Cancel = true; return; } } else { // ถ้าไม่มีการแก้ไข Row แต่ก่อนที่จะเพิ่มแถวใหม่ จะต้อง Validate แถวล่าสุด (ล่างสุด) ก่อน if (shtView.RowCount > 0 && shtView.ActiveRowIndex >= 0) { if (!ValidateRowSpread(shtView.RowCount - 1, true)) { e.Cancel = true; return; } } } //if (shtLotNoList.RowCount > 0 && shtLotNoList.ActiveRowIndex >= 0) //{ // KeyboardSpread a = (KeyboardSpread)sender; // if (a.IsBinded) { // if (a.Owner == fpLotNoList) { // int lastRowNonEmpty = shtLotNoList.GetLastNonEmptyRow(NonEmptyItemFlag.Data); // if (lastRowNonEmpty == shtLotNoList.RowCount - 1) { // if ("".Equals(shtLotNoList.Cells[lastRowNonEmpty, (int)eColView.LOT_NO].Text)) { // e.Cancel = true; // } // } // } // } //} }
void m_keyboardSpread_RowAdding(object sender, EventRowAdding e) { if (m_bRowHasModified) { // ถ้า Row กำลังแก้ไขอยู่ if (!ValidateRowSpread(shtIssueList.ActiveRowIndex, false)) { e.Cancel = true; return; } } else { // ถ้าไม่มีการแก้ไข Row แต่ก่อนที่จะเพิ่มแถวใหม่ จะต้อง Validate แถวล่าสุด (ล่างสุด) ก่อน if (shtIssueList.RowCount > 0 && shtIssueList.ActiveRowIndex >= 0) { if (!ValidateRowSpread(shtIssueList.RowCount - 1, true)) { e.Cancel = true; return; } } } }