dataGridView控制显示

 dataGridView1.DataSource = bindingSource_log;
                   bindingSource_log.DataMember = "dir_ctrl";
                   //SELECT id, op, [date], [user] FROM dir_ctrl
                   OleDbDataAdapter dir = new OleDbDataAdapter(new OleDbCommand("select * from dir_ctrl", oleDbConn));
                   dir.Fill(data_infoDataSet_log.dir_ctrl);

                   get_datagridview_by_name("id").Visible = false;
                   get_datagridview_by_name("op").AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
                    get_datagridview_by_name("op").HeaderText= "操作";
                   get_datagridview_by_name("date").HeaderText = "时间";
                   get_datagridview_by_name("user").HeaderText = "用户";

你可能感兴趣的:(datagridview)