|
-
Aug 7th, 2007, 09:33 AM
#1
Thread Starter
Frenzied Member
How to get DataGridView column location
How do I get the X coordinate of a DGV column relative to the forms left edge? Thanks...
-
Aug 7th, 2007, 09:40 AM
#2
Re: How to get DataGridView column location
You could iterate the columns until you get to the column in question and add the values of their Width properties.
I am not sure if there is a better way of doing this.
-
Aug 7th, 2007, 11:24 AM
#3
Thread Starter
Frenzied Member
Re: How to get DataGridView column location
I thought there was a way to get the X location without having to iterate, but I can't find it now. Anyone know?
-
Aug 7th, 2007, 11:34 AM
#4
Re: How to get DataGridView column location
Are you in the cell?
vb.net Code:
MessageBox.Show(Me.DataGridView1.CurrentCellAddress.X.ToString())
Or do you know its name?
vb.net Code:
MessageBox.Show(Me.DataGridView1.Columns("ContactName").Index.ToString())
-
Aug 7th, 2007, 12:07 PM
#5
Thread Starter
Frenzied Member
Re: How to get DataGridView column location
I'm not looking for the index of the column, but rather its screen coordinate in pixels or whatever the units are.
-
Oct 4th, 2017, 01:05 PM
#6
New Member
Re: How to get DataGridView column location
Grid.GetCellDisplayRectangle(columnIndex, rowIndex, false)
-
Oct 5th, 2017, 02:07 AM
#7
Re: How to get DataGridView column location
Hi bogeco,
this thread is 10 Years old ??
why are you doing this
to hunt a species to extinction is not logical !
since 2010 the number of Tigers are rising again in 2016 - 3900 were counted. with Baby Callas it's 3901, my wife and I had 2-3 months the privilege of raising a Baby Tiger.
-
Oct 5th, 2017, 03:23 AM
#8
New Member
Re: How to get DataGridView column location
this thread is number 1 in google search for this topic, it be useful for people
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|