Solved

Gridview Location

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
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 …

929 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now