public void LoadCategory() { try { dtCategory = CategoryDT.GetAvailableCategoryByDataSet().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; } catch (Exception ex) { MessageBox.Show(ex.Message); } }