嘿,夥計們!我第一次使用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