If you bind a DataGridview (winform) to a list of objects can you define which object property , a string, should be used for the column titles?
At the moment its using the properties names from the objects.
or is it possible to bind a separate datasource, another object, to the column headers for the purpose of defining these titles?
UDATE
Example
public string field_one{get;set;}
Shows up as “field_one” as the column header. I would like…
public string header_one{get;set;}
public string field_one{get;set;}
row.header_one="Friendly Header Title";
...........
List<row> rows = new List<row>();
So that the column header is “Friendly Header Title”
or to have a list of headers in a separate object, list of objects or other list based type.
example
class header...
{
...
public string header_column_one{get;set;}
..
}
....
class row....
{
...
public string field{get;set;}
..
}
…….
……..
header.header_column_one="Nice Friendly Header"
List<row> rows = new List<row>();
Is this possible?
If i’m reading your question right, you’re asking about setting the titles for the columns. DataGridViewColumn’s HeaderText is your ticket.
MSDN Search “DataGridViewColumn”
http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcolumn.aspx