예제 #1
0
파일: Form1.cs 프로젝트: Qruze/Comcare
        static void table_RowChanging(object sender, DataRowChangeEventArgs e)
        {
            Loading load = new Loading();
            Trace.WriteLine(string.Format("DataTable_RowChanging(): Action {0}, RowState {1}", e.Action, e.Row.RowState));

            if (e.Action == DataRowAction.Add)
            {
                e.Row.ClearErrors();

                DataTable updateDataTable = load.RecalcData(sender as DataTable);
                
            }

            if (e.Action == DataRowAction.Change)
            {
                e.Row.ClearErrors();
                DataTable updateDataTable = load.RecalcData(sender as DataTable);
            }
        }
예제 #2
0
파일: Form1.cs 프로젝트: Qruze/Comcare
 private void btn_Refresh_Click(object sender, EventArgs e)
 {
     Loading load = new Loading();
     var foo = (BindingSource)dataGridView1.DataSource;
     
     var test = (DataSet1)foo.DataSource;
     DataTable test2 = load.RecalcData(test.Tables[1]);
     foo.DataSource = test2;
     dataGridView1.DataSource = foo;
     dataGridView1.Refresh();
 }