jvcoach23 Posted August 30, 2005 Posted August 30, 2005 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. DataGrid1.HitTest(e.X, e.Y).Column thanks shannon Quote JvCoach23 VB.Net newbie MS Sql Vet
penfold69 Posted August 31, 2005 Posted August 31, 2005 Dim hti as HitTest = DataGrid1.HitTest(e.X, e.Y) Dim strColumnName as String = DataGrid1.TableStyles(0).GridColumnStyles(hti.Column).Name Quote
jvcoach23 Posted August 31, 2005 Author Posted August 31, 2005 I'm getting an error on the dim hti as hittest says typehittest is not defined.. it's simple isn't it.. what I'm not getting Dim hti as HitTest = DataGrid1.HitTest(e.X, e.Y) Dim strColumnName as String = DataGrid1.TableStyles(0).GridColumnStyles(hti.Column).Name Quote JvCoach23 VB.Net newbie MS Sql Vet
Machaira Posted August 31, 2005 Posted August 31, 2005 I believe HitTest should actually be HitTestInfo. Quote Here's what I'm up to.
penfold69 Posted August 31, 2005 Posted August 31, 2005 I believe HitTest should actually be HitTestInfo. Yup, that'll teach me to roll it off without checking it :P Dim hti As DataGrid.HitTestInfo Quote
jvcoach23 Posted August 31, 2005 Author Posted August 31, 2005 great.. many thanks Quote JvCoach23 VB.Net newbie MS Sql Vet
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.