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_InitNewRow(object sender, DevExpress.XtraGrid.Views.Grid.InitNewRowEventArgs e) { //if (TransView.FocusedRowHandle >= 0) //{ if (TransView.RowCount <= 1) { //e.Row.Cells[2].Value = 0; TransView.SetRowCellValue(TransView.FocusedRowHandle, "FValue", 0); } else { //e.Row.Cells[2].Value = grdTrans.Rows[grdTrans.RowCount - 2].Cells[3].Value; TransView.SetRowCellValue(TransView.FocusedRowHandle, "FValue", Convert.ToInt32(TransView.GetRowCellValue(TransView.RowCount - 2, "TValue"))); } //} //else //{ // //e.Row.Cells[2].Value = 0; // TransView.SetRowCellValue(TransView.FocusedRowHandle, "FValue", 0); //} ////e.Row.Cells[3].Value = 0; //TransView.SetRowCellValue(TransView.FocusedRowHandle, "TValue", 0); //DataRow dr = m_tGrade.NewRow(); //dr[0] = 0; //dr[1] = ""; //dr[2] = 0; //dr[3] = 0; //m_tGrade.Rows.Add(dr); }
private void TransView_InitNewRow(object sender, DevExpress.XtraGrid.Views.Grid.InitNewRowEventArgs e) { TransView.SetRowCellValue(e.RowHandle, "Supply", false); TransView.SetRowCellValue(e.RowHandle, "Contract", false); TransView.SetRowCellValue(e.RowHandle, "Service", false); TransView.SetRowCellValue(e.RowHandle, "MaxPoint", 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); } }