/// <summary> /// RefreshDataGridViewClient - refresh client data grid view /// </summary> public void RefreshDataGridViewClient() { List <ClientModel> list = ClientDataAccess.LoadAllClient(); DataGridView dataGridView = dgvClient; DataTable dataTable = ToDataTable(list); dataGridView.DataSource = dataTable; dataGridView.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.DisplayedCells; //dataGridView.Columns["ClientID"].HeaderText = "Client ID"; //dataGridView.Columns["Name"].HeaderText = "Client Name"; dataGridView.Columns["IsDeleted"].Visible = false; int dgv_width = dataGridView.Columns.GetColumnsWidth(DataGridViewElementStates.Visible); this.Width = 365 + dgv_width; dataGridView.ClearSelection(); }