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.
Unfortunately, activation email could not send to your email. Please try again.

Setting column size in a databound grid

Thread ID:

Created:

Updated:

Platform:

Replies:

7825 Oct 10,2003 09:01 AM Oct 10,2003 09:49 AM Windows Forms 2
loading
Tags: GridControl
Brian Bacon
Asked On October 10, 2003 09:01 AM

I've a parent form, with an mdi child, with a custom panel with a derived data bound grid on it. I'd like to set the default column sizes when my app starts. Here is how I'm setting the widths: Public Sub LayoutGrid() Dim widths() As Integer = {25, 25, 190, 63, 63, 94} Me.mcItems.SetColWidth(0, 5, widths) End Sub I've tried calling this proceedure in my derived grid's OnCreateControl, in my panel's OnCreateControl and in my child form's Load. None of them do anything. However if I add a button to my panel that calls that proceedure it works just fine. How can I do this without requiring user interaction? Is there a better way to set the initial layout of the table?

Administrator [Syncfusion]
Replied On October 10, 2003 09:23 AM

Set databoundGrid.AllowResizeToFit = false to stop the grid from automatically sizing the columns after you set the column widths manually. Stefan

Brian Bacon
Replied On October 10, 2003 09:49 AM

Well now dont I feel sheepish... I thought I had done that. Thanks again Stefan.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;