private void TransView_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e) { if (m_bAns == false) { return; } int rowhandleva = TransView.GetDataSourceRowIndex(TransView.FocusedRowHandle); m_oCountry.CountryName = cCName; if (TransView.IsNewItemRow(TransView.FocusedRowHandle) == true) { int cId; cId = m_oCountry.InsertCountry(m_oCountry.CountryName); m_bAns = false; TransView.SetRowCellValue(TransView.FocusedRowHandle, "CountryId", cId); m_bAns = true; } else { m_oCountry.CountryId = Convert.ToInt32(TransView.GetRowCellValue(TransView.FocusedRowHandle, "CountryId")); m_oCountry.UpdateCountry(m_oCountry.CountryId, m_oCountry.CountryName); } m_bEdit = false; }
private void TransView_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e) { if (TransView.FocusedColumn.FieldName == "TValue") { int rHandle = TransView.GetDataSourceRowIndex(TransView.FocusedRowHandle); Decimal tValue = Convert.ToDecimal(TransView.GetRowCellValue(rHandle - 1, "TValue")); Decimal tCurValue = Convert.ToDecimal(TransView.GetRowCellValue(TransView.FocusedRowHandle, "TValue")); if (tCurValue <= tValue) { DataRow dr = TransView.GetDataRow(TransView.FocusedRowHandle); dr["TValue"] = 0; } } }
private void TransView_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e) { if (m_bAns == true) { return; } int rowhandleva = TransView.GetDataSourceRowIndex(TransView.FocusedRowHandle); if (TransView.IsNewItemRow(TransView.FocusedRowHandle) == true) { int iID = m_lFBL.InsertFDesc(m_lFDescription); m_bAns = true; TransView.SetRowCellValue(TransView.FocusedRowHandle, "FeatureId", iID); m_bAns = false; } else { m_lFeatureId = Convert.ToInt32(TransView.GetRowCellValue(TransView.FocusedRowHandle, "FeatureId")); m_lFBL.UpdateFDesc(m_lFeatureId, m_lFDescription); } }