dataGridview 查看列是否存在..........




            

 if (dataGridView1.Columns["Note"] != null)
                {
                    //do something
                }




                foreach (DictionaryEntry de in DataClass.HtTables.Ht_AdjSheetDInf)
                {
                    if (dataGridView1.Columns[de.Key.ToString() ] != null)
                    {
                        dataGridView1.Columns[de.Key.ToString() ].HeaderText = de.Value.ToString();
                    }
                }



你可能感兴趣的:(dataGridview 查看列是否存在..........)