0
我不知道如果我失去了一些东西,但对于我的生活我不能让网格是可编辑的。Gridview在C++窗体窗体应用程序不能编辑
我正在做的是将文件加载到字典中,然后将该字典绑定到网格。
网格显示词典中的数据,但我不能编辑网格中的任何数据。
我试图改变模式也:
- EditOnEnter
- EditOnKeyStroke
而缥缈。
任何想法? PS:我在C++中没有做太多的GUI工作,所以也许我忽略了一些东西。
这是我如何加载网格。
Dictionary<String^, String^>^ data = gcnew Dictionary<String^, String^>();
BindingSource^ bindingSource1 = gcnew BindingSource();
// Read and display lines from the file until the end of the file is reached.
while (line = sr->ReadLine())
{
array<String^>^split = line->Split(chars);
data->Add(split[0], split[1]);
}
dataGridView1->DataSource = bindingSource1;
bindingSource1->DataSource = data;
dataGridView1->AutoResizeColumns(DataGridViewAutoSizeColumnsMode::AllCells);
提前致谢。