Solved

Gridview Location

Posted on 2009-07-06
4
354 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
Comment Utility
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
Comment Utility
Hi Woodz

The QuoteGridView is a System.windows.Forms.datagridview

Regards
Joe

0
 
LVL 4

Accepted Solution

by:
Woodz earned 250 total points
Comment Utility
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
Comment Utility
Hi Woodz

With the dock removed the code works fine!

Regards
JoeBo
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

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…
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)…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

763 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

7 Experts available now in Live!

Get 1:1 Help Now