Click here to Skip to main content
15,907,149 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a datagridview in my project(windows form application in c#)
I can see name of it in properties panel and set location of it to center of form and size of it to 400*400. but I can not find it on my design form.
how to find my control in form?
Posted
Comments
George Jonsson 4-Oct-14 23:36pm    
I suppose you mean in the designer in Visual Studio and not by code.
Make sure the property Visible is set to true.
Sergey Alexandrovich Kryukov 4-Oct-14 23:50pm    
No, in design view, controls with false value Visible properties are visible. There are many ways to "loose" the control from design, slip of a hand or just inaccurate work.
—SA
George Jonsson 4-Oct-14 23:55pm    
Ah, you are right.
Then make sure the auto-generated code for adding the DataGridView still exists in the xxx.Designer.cs
Sergey Alexandrovich Kryukov 5-Oct-14 0:05am    
Sure. It's important to understand that this auto-generated code is the only source of data for the designer. In particular, there is nothing wrong in fixing this code manually, if this is done with proper understanding.
I actually added some advice in Solution 1.
—SA
Sergey Alexandrovich Kryukov 4-Oct-14 23:51pm    
Please see my comment above. Just do you work accurately and get some experience, don't overuse the designer. There is no such problem per se, there is just not enough experience. Practice on some project, learn the process. There is nothing to help with, based on your very general information.
—SA

Please see my comments to the question — my main advice is in those comments. Now, on top of the PropertyGrid is Visual Studio there is a list of all controls on a form. Look it through to find the lost control. Chances are, you well need to accurately redo the design of a form.

One advice is so important that is won't be a great sin to repeat it: don't overuse the designer. Don't position any controls manually and don't manually size most of them. Instead, use combination of the properties Dock and Padding, don't use default docking (DockStyle.None).

—SA
 
Share this answer
 
Check the value of these properties of the GridView in the PropertyGrid window:

1. Location : is it outside the bounds of the Form

2. Size : is something weird about the size parameters

3. Visible : obvious

Check the z-order of the GridView: is another Control on top of it, hiding it.

The reason it is not visible on the design surface almost has to be one of the above.
 
Share this answer
 
I think these steps can solve your Problem:
1.check for control property visible="true",
2.check property Height & width ,
3.css not applied properly or design issues,
at last drag your control again and replace properties of your control by old one.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900