如题。
使用方法简写:
private List<SaleProductInfo> saleProductList = new List<SaleProductInfo>(); private BindingSource bs = new BindingSource(); public FrmSaleManage() { InitializeComponent(); this.dgvProdutList.AutoGenerateColumns = false; } private void Funcation() { //数据绑定 this.bs.DataSource = this.saleProductList; this.dgvProdutList.DataSource = null; this.dgvProdutList.DataSource = this.bs; }
BindingSource提供的方法:
this.bs.MoveLast();//dgv聚焦到最后一行