devexpress xtragrid "data" changed c# (datasource= datatable *bindingsource*)

//tanımlama
private System.Collections.ArrayList pr_AryDegisenFieldNameSoft  ;
private System.Collections.ArrayList pr_AryDegisenRowindexSoft ;


//void new
private void DegisenleriSifirlaSoft()
{
this.pr_AryDegisenRowindexSoft = new System.Collections.ArrayList();
this.pr_AryDegisenFieldNameSoft = new System.Collections.ArrayList();
}

//fonksiyon ret. bool
public bool Fn_KayitDegistiSoft()
{
bool Result = false;

this.gridViewSoft.PostEditor();
this.bindingSourceSoft.EndEdit();

DataTable dtableSoft = this.dataSetTeknikServisMalzemeler.tb_TeknikServis_MalzemelerSoft;

Result = dtableSoft.GetChanges(DataRowState.Modified) != null;


return Result;
}



//cellvaluechanged
private void gridViewSoft_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
{
this.pr_AryDegisenFieldNameSoft.Add(e.Column.FieldName);
this.pr_AryDegisenRowindexSoft.Add(e.RowHandle);
}

//rowcellstyle
private void gridViewSoft_RowCellStyle(object sender, DevExpress.XtraGrid.Views.Grid.RowCellStyleEventArgs e)
{
if (this.pr_AryDegisenFieldNameSoft.Contains(e.Column.FieldName) && this.pr_AryDegisenRowindexSoft.Contains(e.RowHandle))
{
e.Appearance.BackColor = Color.LightYellow;
e.Appearance.ForeColor = Color.Maroon;
}
}

//formclosing event.. kontrol et.
private void FormMalzemeler_FormClosing(object sender, FormClosingEventArgs e)
{
if (Fn_KayitDegistiSoft() == true)
{
DialogResult result = MessageBox.Show(this,
"Soft Kayıtları Değişmiş. Yinede Ekranı Kapatacakmısınız?",
"Kayıt Değişmiş",
MessageBoxButtons.YesNo, MessageBoxIcon.Question);

if (result == System.Windows.Forms.DialogResult.Yes)
{ e.Cancel = false; }
else { e.Cancel = true; }
}
}





Yorumlar