Windows Develop Bookmark and Share   
 index > Windows Forms General > DataGrid does not render unless I dock the dataGrid
 

DataGrid does not render unless I dock the dataGrid

Could some one Give me a hand. I have a dinamic GridView and The dam thing does not render on my application unless I dock it.
  • Moved byOmegaManMVPTuesday, May 26, 2009 6:32 PM (From:Visual C# General)
  •  
Zap-Man  Tuesday, May 26, 2009 5:42 PM

Hi Zap-Man,

Based on my understanding, I think youwant to reset the location and the size of the DataGridView when the form is resized or moved.

Except docking, you can anchor it to some sides to solve the problem.

Anchor example: Set the Anchor property to AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right. This will fix the DataGridView's location and change its width if needed to anchor it to the three edges of the form.

Let me know if this helps.
Aland Li


Please mark the replies as answers if they help and unmark if they don't.
Aland Li  Tuesday, June 02, 2009 4:59 AM
Do you mean a WinForms DataGridview or a WebForms DataGrid?

Could you post a snippet of the code you are using?
www.insteptech.com
We are volunteers and ask only that if we are able to help you, that you mark our reply as your answer. THANKS!
DeborahK  Tuesday, May 26, 2009 5:55 PM

Hi Zap-Man,

Based on my understanding, I think you created the GridView in code, not in designer. From my experience, the problem is mostly related to the location and size of your form. You need to check whether you set the size and location appropriately.

Let me know if this helps,
Aland Li


Please mark the replies as answers if they help and unmark if they don't.
Aland Li  Thursday, May 28, 2009 10:25 AM

Hi Zap-Man,

Based on my understanding, I think youwant to reset the location and the size of the DataGridView when the form is resized or moved.

Except docking, you can anchor it to some sides to solve the problem.

Anchor example: Set the Anchor property to AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right. This will fix the DataGridView's location and change its width if needed to anchor it to the three edges of the form.

Let me know if this helps.
Aland Li


Please mark the replies as answers if they help and unmark if they don't.
Aland Li  Tuesday, June 02, 2009 4:59 AM

You can use google to search for other answers

Custom Search

More Threads

• Selecting Multiple Lines From A TextBox
• Adding controls in windows datagrid
• anyone have any experience with Mere Mortals.Net Application Framework or any other App Framework products?
• Value, Text pair in combo box
• Declare New Form
• RichTextBox in ToolStrip control?
• Pixel painting with GDI
• Runtime Errot
• Break WinForm into 3 equal areas
• Datatype Identifier...