Better Auto-Generated Column Names for DataGridView

  • Thread starter Thread starter jehugaleahsa
  • Start date Start date
J

jehugaleahsa

Did the all-wise writers of DataGridView think of making an attribute
we could apply to our class properties to give them prettier column
names?

It is nice and all having a property called 'CustName', however,
having to manually replace the column name is getting to be a rough
trail to follow. It would be nice if I could order my properties as
well.

Do such attributes exist? Is there a nice website that has a list of
useful attributes?

Thanks muchly,
Travis
 
Travis,

Have you seen the section of the MSDN documentation titled "Interfaces
Related to Data Binding", located at:

http://msdn2.microsoft.com/en-us/library/41e17s4b.aspx

Specifically, the ITypedList interface and the ICustomTypeDescriptor
interfaces should help you with describing the properties of your type (and
possibly giving better names than your property names) as well as specifying
the order they are displayed in (although I think you can handle the
ordering by creating the data grid columns and adding them to the grid view
in the order you want).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top