datagrid column header name question

jvcoach23

Centurion
Joined
May 22, 2003
Messages
192
Location
Saybrook, IL
I have a datagrid.. I'd like to know how you click on a column.. and get the column header name.

I tried something like this and can get the index value.. but can't figure out how to get the actual name.

Visual Basic:
DataGrid1.HitTest(e.X, e.Y).Column

thanks
shannon
 
Visual Basic:
Dim hti as HitTest = DataGrid1.HitTest(e.X, e.Y)
Dim strColumnName as String = DataGrid1.TableStyles(0).GridColumnStyles(hti.Column).Name
 
I'm getting an error on the
Visual Basic:
dim hti as hittest

says typehittest is not defined..
it's simple isn't it.. what I'm not getting

penfold69 said:
Visual Basic:
Dim hti as HitTest = DataGrid1.HitTest(e.X, e.Y)
Dim strColumnName as String = DataGrid1.TableStyles(0).GridColumnStyles(hti.Column).Name
 
Back
Top