We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to anchor a GridControl

Hi, How do you set the anchor ehavior of a GridControl? When I drop one on a form, then set the anchor to all4 sides, I would have expected the GridControl to resize when I resize the form. However, the GridControl deosn''t seem to be effected by the anchor styles -- it doen''t resize as I would expect. Thanks,

4 Replies

AD Administrator Syncfusion Team May 5, 2005 12:14 AM UTC

The Anchor property on the GridControl should behave the same as on any other Control. Check to make sure the Dock property is not also set. If it is, it will override the Anchor settings. Check what the grid''s parent is? The anchoring of a control is to its parent''s bounds. If this does not explain what you are seeing, can you upload a sample project showing the problem?


JD John Dumais May 5, 2005 12:28 AM UTC

It doesn''t look like the dock proprty is set. I''ll attach a very simple solution. Grab the for and resize it. Thanks, >The Anchor property on the GridControl should behave the same as on any other Control. > >Check to make sure the Dock property is not also set. If it is, it will override the Anchor settings. > >Check what the grid''s parent is? The anchoring of a control is to its parent''s bounds. > >If this does not explain what you are seeing, can you upload a sample project showing the problem? Dorkin3_6314.zip


AD Administrator Syncfusion Team May 5, 2005 12:50 AM UTC

In your sample, the grid is sizing for me. Add a BorderStyle property to the grid and it will be more obvious that the grid bounds are changing as your size the form. Are you expecting the columns in the grid to resize as you resize the form? If so, you will have to handle grid.Model.QueryColWidth event to manage this. You can see a sample of this in \Syncfusion\Essential Studio\3.2.1.0\Windows\Grid.Windows\Samples\DataBound\GridDataBoundImageCell.


JD John Dumais May 5, 2005 01:00 AM UTC

Ah. Thanks.

Loader.
Live Chat Icon For mobile
Up arrow icon