DevExpress控件使用总结(不断更新中)


数据绑定

class RowDataRecord
    {
        public RowDataRecord(int n_id, string xmlpath)
        {
            n_id_ = n_id;
            xmlpath_ = xmlpath;      
        }
        //!编号
        public int n_id_ { get; set; }
        //!路径
        public string xmlpath_ { get; set; }

    }
 public void InitialDialog()
        {
            ///影像列表更新
            studentList = new List<RowDataRecord>();        
            this.grid_control_.DataSource = studentList;
            this.grid_control_.RefreshDataSource();
        }

数据有两列,第一列为序号,int型,第二列为数据路径,string型。
设计界面
添加两列


如何清空gridview

  private void DeleteClear(object sender, EventArgs e)
        {

            this.gridView1.SelectAll();///选中所有行
            this.gridView1.DeleteSelectedRows();///清空所有行
            this.gridControl1.RefreshDataSource();///绑定数据刷新

        }

猜你喜欢

转载自blog.csdn.net/u013230291/article/details/79530982