Re: DataGridView can't put spaces in column header when using Datasource property ?
- From: "Jack" <someone@xxxxxxxxxxxxx>
- Date: Wed, 24 Jun 2009 18:32:12 +0800
Oh i worked it out.
You have to set the 'DataPropertyName' property of the datagridview
column(s), to the name of the public property that exists in the collection
that you set the 'Datasource' property of the datadridview to.
Umm.. did that make sense? lol
Jack.
"Jack" <someone@xxxxxxxxxxxxx> wrote in message
news:ZaadnVF4btxbcNzXnZ2dnUVZ_tWdnZ2d@xxxxxxxxxxxxxxxxxx
Hello,
How do i make the datadridview column header text have a space in them?
I insert a list of items into the datagridview's datasource property which
comes from a database table. It obviously gets the column header text from
the field name in the database; the database field name is 'MobilePhone'
but
i want the column to display 'Mobile Phone'. I would like the column
headers
to have spaces in them to make it look nice to the user.
I tried inserting columns at design time, and matched the names, but what
happens is that i get the columns i set at design time appear, AND the
columns that appear when i set the list to the datasource property. this
means i have double the set of columns.
I set the AutoGenerateColumns to false. Now i only have my design-time
defined columns which is good, but the actual data doesn't display in the
cells ?!?
How can i do this? (Maybe there is some attribute?)
Jack.
.
- References:
- Prev by Date: DataGridView can't put spaces in column header when using Datasource property ?
- Next by Date: Re: OpenFileDialog - get Microsoft Live files
- Previous by thread: DataGridView can't put spaces in column header when using Datasource property ?
- Index(es):
Relevant Pages
|