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.

Auto-Sizing Columns

Thread ID:

Created:

Updated:

Platform:

Replies:

76615 Sep 16,2008 02:36 PM Sep 18,2008 11:20 AM Windows Forms 2
loading
Tags: GridControl
abc
Asked On September 16, 2008 02:36 PM

How do I auto-size the columns in a GridDataBoundGrid control? I know how to do it in a GridControl control, but the object model for GridDataBoundGrid seems to be completely different.

-TC


Nisha Arockiya A [Syncfusion]
Replied On September 17, 2008 01:17 AM

Hi,

Thanks for your interest in Syncfusion Products.

If you want to autosize the columns to fit the text, you can call the ResizeToFit member of the ColWidths class. You can pass in any range you want to resize. This code does the whole table.


this.gridDataBoundGrid1.Model.ColWidths.ResizeToFit(GridRangeInfo.Table);


Please let me know if this is not the information you need.

Regards,
Nisha


>How do I auto-size the columns in a GridDataBoundGrid control? I know how to do it in a GridControl control, but the object model for GridDataBoundGrid seems to be completely different.

-TC




abc
Replied On September 18, 2008 11:20 AM

Nisha,

Thank you. That worked great.

-TC


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.

;