嘿,伙计们!我第一次使用Visual Studio 2008 Windows Form Application与C++。添加列时出现DataGridView问题
我想把一个dataGridView放在我的表单上。那没问题。但是当添加一列时,在gridView上会出现2列。首先没有标题(我不想),第二个是好的(我的专栏)。我试图从代码中设置列号,但同样的事情发生。
任何想法解决这个?
感谢, 安德鲁
//
// table
//
this->table->AllowUserToAddRows = false;
this->table->AllowUserToDeleteRows = false;
this->table->ColumnHeadersHeightSizeMode = System::Windows::Forms::DataGridViewColumnHeadersHeightSizeMode::AutoSize;
this->table->Columns->AddRange(gcnew cli::array<System::Windows::Forms::DataGridViewColumn^>(1) {this->Column1});
this->table->Location = System::Drawing::Point(13, 89);
this->table->Name = L"table";
this->table->ReadOnly = true;
this->table->Size = System::Drawing::Size(240, 150);
this->table->TabIndex = 2;
//
// Column1
//
this->Column1->HeaderText = L"Column1";
this->Column1->Name = L"Column1";
this->Column1->ReadOnly = true;
你可以发布一个简单的例子吗? – 2011-04-29 17:27:38
我编辑了我的帖子并添加了示例代码 – Andrew 2011-04-29 18:11:58
请问您可以用语言标记问题。它看起来像c + + – 2011-04-29 19:36:59