Solved

Gridview Location

Posted on 2009-07-06
4
359 Views
Last Modified: 2012-05-07
Hi
I have a toolbar and a gridview on a form with the toolbar located at the top of the form and I am attempting to change the location of a gridview to place its top below the toolbar using

Me.QuoteGridView.Location = New System.Drawing.Point(0, 22)

but the gridview location doe's not change, can anyone spot the reason why?

Regards
Joe
0
Comment
Question by:JoeBo747
  • 2
  • 2
4 Comments
 
LVL 4

Expert Comment

by:Woodz
ID: 24786011
Can you clarify the full data type of the QuoteGridView variable, as there are several GridView classes in the .NET framework.
0
 
LVL 1

Author Comment

by:JoeBo747
ID: 24786149
Hi Woodz

The QuoteGridView is a System.windows.Forms.datagridview

Regards
Joe

0
 
LVL 4

Accepted Solution

by:
Woodz earned 250 total points
ID: 24788928
The command that you are using is correct for the task intended, so the problem could be caused by the location of this command. I have tested it with the command in the winform constructor, which is invoked before the screen is displayed, so the location value is correctly set before the screen is drawn.

If you are setting the location after it has been drawn, it may not take alter the position until the screen is refreshed, which you can force by calling Me.Refresh(). Alternatively, if you set the .Anchor or .Dock properties, this could override the explicit location setting.
0
 
LVL 1

Author Closing Comment

by:JoeBo747
ID: 31600103
Hi Woodz

With the dock removed the code works fine!

Regards
JoeBo
0

Featured Post

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question