0

hey
im using vc++ clr to build my application...im using the datagridview, but im having some problems with it because its quite poorly documented in C++..i want to know a couple of things.

1... how to change the color and text of a single row header cell as well as the text in the row header cell.

2... how to change the standard column width..

thanks in advance :)

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by thines01
1

Here are some things to contemplate:

private: System::Void Form1_Load(System::Object^  sender, System::EventArgs^  e)
   {
      dataGridView1->Columns->Add("asdf", "myASDF");

      // set the column width
      dataGridView1->Columns[0]->Width = 444;

      // Add some rows
      for (int i = 0; i < 3; i++)
      {
         dataGridView1->Rows->Add();
         dataGridView1->Rows[i]->Cells[0]->Value = "adsf " + i.ToString();
      }

      // Change the header text color
      dataGridView1->Columns[0]->HeaderCell->Style->ForeColor = Color::Green;

      // Change a cell's text color
      dataGridView1->Rows[1]->Cells[0]->Style->ForeColor = Color::Red;
   }
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.