DataGridViewに余分な列が表示されています。アプリケーションはWindowsフォームアプリケーションです。私は何が間違っていますか?Windowsフォーム:DataGridViewの余分な列
public ConvertisForm1()
{
InitializeComponent();
openFileDialog.Filter = "Files| *.chm;*.htm;*.html;*.rtf;*.xls;*.xlsx;*.xps;*.doc;*.docx";
dataGridView.AutoGenerateColumns = false;
dataGridView.RowHeadersVisible = false;
dataGridView.ColumnCount = 5;
dataGridView.RowCount = 20;
//delete button
var deleteDataGridViewButtonColumn = new DataGridViewButtonColumn
{
HeaderText = "",
Name = deleteDataGridViewButtonColumnName,
Text = "X",
Width =20
};
dataGridView.Columns.Insert(DeleteColumnIndex, deleteDataGridViewButtonColumn);
dataGridView.Columns[FileNameAndPathColumnIndex].Width=250;
dataGridView.Columns[FileNameAndPathColumnIndex].HeaderText = "File Path";
//browse button
var browseDataGridViewButtonColumn = new DataGridViewButtonColumn
{
HeaderText = "",
Name = browseDataGridViewButtonColumnName,
Text = "...",
Width = 30
};
dataGridView.Columns.Insert(BrowseButtonColumnIndex, browseDataGridViewButtonColumn);
//convert to dropdown
var convertToDataGridViewComboBoxColumn = new DataGridViewComboBoxColumn
{
HeaderText = "Convert to",
Name = convertToDataGridViewComboBoxColumnName,
DataSource = new ArrayList { convertToComboBoxDefault, "pdf", "word"},
Width = 100,
DefaultCellStyle =
{
NullValue = convertToComboBoxDefault,
DataSourceNullValue = convertToComboBoxDefault
}
};
dataGridView.Columns.Insert(ConvertToFileTypeColumnIndex, convertToDataGridViewComboBoxColumn);
var convertDataGridViewButtonColumn = new DataGridViewButtonColumn
{
HeaderText = "",
Name = convertDataGridViewButtonColumnName,
Text = "Convert",
Width = 50
};
dataGridView.Columns.Insert(ConvertButtonColumnIndex, convertDataGridViewButtonColumn);
dataGridView.AllowUserToResizeColumns = false;
dataGridView.AllowUserToResizeRows = false;
#endregion
}
です。 ? – active92
@ active92あなたはそれを質問する必要はありません。 :-) – LarsTech