DataGrid - How to get name of selected cell's column heading name?

Jan 19 2004 1:49 PM
Hi forum, I am trying to design some generic forms that can be used to dynamically bind to any type of business object. At the moment I am binding a System.Windows.Forms.DataGrid to an ArrayList of custom business objects. And I am not using any DataGridTableStyle. So that means for every public property in my class there is a column in the grid. This is great, but how am I able to get the column heading name of a selected cell so that I may perform some reflection on the selected object/property? I need the column heading name which is the same as the property name. How do I get the column heading name? Am unable to find any documentation on how to do this. Help! Please, Thanking in advance for any help greatly appreciated.

Answers (1)