Solved

Gridview Location

Posted on 2009-07-06
4
357 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

IP addresses can be stored in a database in any of several ways.  These ways may vary based on the volume of the data.  I was dealing with quite a large amount of data for user authentication purpose, and needed a way to minimize the storage.   …
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

821 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