private void btnAdd_Click(object sender, EventArgs e) { DataRow m_Row = m_DanTocCtrl.ThemDongMoi(); m_Row["MaDanToc"] = "DT" + quyDinh.LaySTT(dgvDantoc.Rows.Count + 1); m_Row["TenDanToc"] = ""; m_DanTocCtrl.ThemDanToc(m_Row); bdgDantoc.BindingSource.MoveLast(); }
private void bindingNavigatorAddNewItem_Click(object sender, EventArgs e) { if (dGVDanToc.RowCount == 0) { bindingNavigatorDeleteItem.Enabled = true; } DataRow m_Row = m_DanTocCtrl.ThemDongMoi(); m_Row["MaDanToc"] = "DT" + quyDinh.LaySTT(dGVDanToc.Rows.Count + 1); m_Row["TenDanToc"] = ""; m_DanTocCtrl.ThemDanToc(m_Row); bindingNavigatorDanToc.BindingSource.MoveLast(); }