话不多说,直接贴代码
//这里是自定义的DataGridViewTreeViewColumn类型 , VS自带的如DataGridViewTextBoxColumn
DataGridViewTreeViewColumn treeViewColumn = new DataGridViewTreeViewColumn();
treeViewColumn.Name = "Name";
treeViewColumn.HeaderText = "Name";
dataGridView1.Columns.Add(treeViewColumn);
网友评论