コード例 #1
0
ファイル: ProductManagement.cs プロジェクト: huynhp0502/.NET
        public void LoadCategory()
        {
            try
            {
                dtCategory            = CategoryDT.GetCategoryByDataSet().Tables[0];
                dtCategory.PrimaryKey = new DataColumn[] { dtCategory.Columns[0] };

                txtCategoryID.Enabled = false;
                txtCategory.Enabled   = false;
                txtProductID.Enabled  = false;

                dgvCategory.DataSource         = dtCategory;
                dgvCategory.Columns[0].Visible = false;
                dgvCategory.Columns[2].Visible = false;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }