DataGridView Title text

Progress2007

Active member
Joined
Sep 5, 2008
Messages
25
Programming Experience
1-3
Hi i want to put a title for datagridview.. Some one suggested eto used a panel and a label to do this.

but i don't want to do like this.

Please tell me is it possible in DataGridView to have title
 
Do you mean a title for the whole datagridview? or for each column/row?

I think you mean for the whole datagridview. You can certainly give the DataGridView a name and use that name to populate a text box with formatting? Would that work for you?

So, the DGV would look like

datagridview.name = "My awesome cars"

and then you could use the form load event for the form label

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Label the data grid view
Me.somelabel.text = me.datagridview.name
end sub


Otherwise if you mean column header text, you would have

Me.datagridview.Columns(0).HeaderCell.ToolTipText = "Some text as a tooltip"
Me.datagridview.Columns(0).HeaderCell.Value = "Mon 1"

which would have a tooltip when you mouse over, and some text for the user to see for that column.

Hope this helps ???
 
There is no caption property for the DataGridView like the DataGrid had.

It sounds like he'd be using this in several places and doesn't want to go through the process of datagridview/label/panel every time. His best bet is to create a composite control if this is the issue.
 
Back
Top