/// <summary> /// 刷新 /// </summary> void RefreshDataGridView() { DataTable dt = m_personnelServer.GetCardIDWorkIDMapping(); dataGridView1.DataSource = dt; this.dataGridView1.ColumnWidthChanged -= new System.Windows.Forms.DataGridViewColumnEventHandler( this.dataGridView1_ColumnWidthChanged); ColumnWidthControl.SetDataGridView(labelTitle.Text, dataGridView1); this.dataGridView1.ColumnWidthChanged += new System.Windows.Forms.DataGridViewColumnEventHandler( this.dataGridView1_ColumnWidthChanged); // 添加查询用的列 if (m_findField == null) { List <string> lstColumnName = new List <string>(); for (int i = 0; i < dataGridView1.Columns.Count; i++) { if (dataGridView1.Columns[i].Visible) { lstColumnName.Add(dataGridView1.Columns[i].Name); } } m_findField = lstColumnName.ToArray(); } userControlDataLocalizer1.Init(dataGridView1, this.Name, UniversalFunction.SelectHideFields(this.Name, dataGridView1.Name, BasicInfo.LoginID)); dataGridView1.Refresh(); }