コード例 #1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            List <ELMAH_Error> ls = ((List <ELMAH_Error>) this.gridControl1.DataSource);
            DataPagingBL       bl = new DataPagingBL();

            bl.UpdateList(ls);
            ;
            XtraMessageBox.Show("更新成功!");
        }
コード例 #2
0
        private void BtnSave_Click(object sender, EventArgs e)
        {
            //List直接绑定到GridControl时可这样转换,但通过BindingSource控件的时侯不能这样转换
            //List<ELMAH_Error> ls = ((List<ELMAH_Error>)this.gridControl1.DataSource);

            List <ELMAH_Error> ls = ((BindingSource)this.gridControl1.DataSource).List as List <ELMAH_Error>;
            DataPagingBL       bl = new DataPagingBL();

            bl.UpdateList(ls);
            ;
            XtraMessageBox.Show("更新成功!");
        }