473,484 Members | 1,722 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

C# App - Issues with docking, controls not logical

27 New Member
Hi guys,

Just a quick question which i am fairly stumped with. I have had a look around, but it seems to be so simple there hasn't been many problems with it from other people.

My issue is that i have a toolstrip and a datagridview and the datagridview isnt finding the toolstrip above it, and when it is doing a fill dock it is cutting a part of itself off from the user.

I have created these objects using code (has to be through code) and they are inside of a splitcontainer.

Expand|Select|Wrap|Line Numbers
  1. ToolStrip strip = new ToolStrip();
  2.  
  3. DataGridView grid = new DataGridView();
  4. DataGridViewButtonColumn columnn = new DataGridViewButtonColumn();
  5. grid.Dock = DockStyle.Fill;
  6. grid.Columns.Add(columnn);
  7.  
  8. splitContainer1.Panel2.Controls.Add(strip);
  9. splitContainer1.Panel2.Controls.Add(grid);
I have tried adding a dock to the toolstrip and invalidating the panel, but it dosent seem to work.

Any help would be really appreciated.

Cheers
Dec 8 '08 #1
3 3521
Looser
3 New Member
simply change the order of lines, where you are adding controls to your parent control (panel2)
So change order of 8. and 9. line to:

splitContainer1.Panel2.Controls.Add(grid);
splitContainer1.Panel2.Controls.Add(strip);
Dec 8 '08 #2
Gun Slinger
27 New Member
wow.... that simple. I was sure i tried that before.

Logically i was sure its the otherway around though. Cause the datagridview would see that there was a toolstrip and make sure that it didnt overlap.

Thanks dude. Answered!
Dec 8 '08 #3
Plater
7,872 Recognized Expert Expert
I believe that when the control is added, it "adjusts" any other controls that are already there, not adjust itself after examining what is already there
Dec 8 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
3107
by: ka | last post by:
I'm using Corwnwood.Magic library for docking in my application. My application to let the users to create their screen look to show some particular data. I treid to dock my things in the way,...
3
1606
by: Peter | last post by:
Hello Thanks for reviewing my question. I have a simple question. I would like to know how you can arrange the docking order? For example, when I add a toolbar and I set the dock to TOP and...
1
1367
by: juli jul | last post by:
Hello, I need to place those controls in the form in the order that I am writing: 1)ListView (aligned dock to "Fill") 2)Spliter aligned to left(dock=left). 3)TreeView aligned to...
2
2684
by: Gary Shell | last post by:
We are playing around with using the splitter on a form and want to do the following: 1. On the left side of the form will be a tree view. 2. To the right of that tree view would be a splitter....
7
3095
by: Chris Dunaway | last post by:
Where/How does VS determing docking order? I created a form with a panel docked to the top and a tab control with fill docking. I had added some tabs and place some controls, etc., and decided...
25
5284
by: Dennis | last post by:
Has anyone really gotten the Docking and Splitter Bars to work for anyting but the simplest application for two controls and one splitter bar filling the whole form? If so, can you enlighten my on...
4
1440
by: Tor Inge Rislaa | last post by:
Docking of controls I have a ToolBar on top of my form. The property Dock is set to Top. Beneath that I have a Panel as have the same Dock setting set to Top. The panel is Beneath the ToolBar...
4
4983
by: Enrique | last post by:
hi all, i'd like to know how i could do a docking menu and docking toolbar. i know it's not so easy y VS .NET 2002 and 2003. anything will help me: links, code, articles..... thanks a...
3
3317
by: adebiasio | last post by:
Does anybody have any code samples that show me how to dock tabs around a form. I have found numerous controls out there that does the job, but I want to learn how to code it myself. Any sites...
0
6953
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7105
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6813
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5407
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4845
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4529
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3041
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1359
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
592
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.