DataGridView doesn't seem to honor the DataColumn.Caption Property

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

The DataGridView doesn't show the datacolumn caption it seems to only show
the name.
Has anybody else seen this problem?
 
The Caption property belongs to a DataColumn. This property is supposed to
be honored by UI objects such as the DataGrid and I was guessing the
DataGridView.
 
The Caption property belongs to a DataColumn. This property is supposed to
be honored by UI objects such as the DataGrid and I was guessing the
DataGridView.

Oldman,

I tried doing the caption setting as below, and you are right. The
DataGridView appears to ignore the settings.

public Form1()
{
InitializeComponent();
this.simpleLogDataSet.Log.Columns[1].Caption = "Call";

}

private void Form1_Load(object sender, EventArgs e)
{
this.simpleLogDataSet.Log.Columns[1].Caption = "Call";
this.logTableAdapter.Fill(this.simpleLogDataSet.Log);
}

Interseting. I even tried setting the HeaderText property of the
coumn in the DataGridView to an empty string and that didn't work
either. I guess the HeaderText property is the only way.

Otis Mukinfus
http://www.otismukinfus.com
http://www.tomchilders.com
 
That is what I was afraid of. That's ok. I'm just going to set the header
text to the caption property of the datacolumn manually.
Wonder if I should report this as a bug.

Otis Mukinfus said:
The Caption property belongs to a DataColumn. This property is supposed to
be honored by UI objects such as the DataGrid and I was guessing the
DataGridView.

Oldman,

I tried doing the caption setting as below, and you are right. The
DataGridView appears to ignore the settings.

public Form1()
{
InitializeComponent();
this.simpleLogDataSet.Log.Columns[1].Caption = "Call";

}

private void Form1_Load(object sender, EventArgs e)
{
this.simpleLogDataSet.Log.Columns[1].Caption = "Call";
this.logTableAdapter.Fill(this.simpleLogDataSet.Log);
}

Interseting. I even tried setting the HeaderText property of the
coumn in the DataGridView to an empty string and that didn't work
either. I guess the HeaderText property is the only way.

Otis Mukinfus
http://www.otismukinfus.com
http://www.tomchilders.com
 
Back
Top