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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Changing the length of cell holding column names in DBDG

Thread ID:

Created:

Updated:

Platform:

Replies:

47697 Aug 10,2006 09:16 AM UTC Aug 10,2006 09:33 AM UTC WinForms 1
loading
Tags: GridControl
Suhas
Asked On August 10, 2006 09:16 AM UTC

Hi all,

I''m using DBDG.
when I load a table, the column names get spanned on two lines as the space is not sufficient to show the column name in one line.
Can some one tell how to dynamically change the width of column to match with the length of the text held by that cell.

Thanks in advance
Suhas

Administrator [Syncfusion]
Replied On August 10, 2006 09:33 AM UTC

Hi Suhas,

Please set the AllowResizeToFit property of the databoundgrid to true in the form_Load, this will help you to display the entire name in single line. This property is true by default.

this.gridDataBoundGrid1.AllowResizeToFit = true;

You can call the ResizeToFit method to dynamically make the contents of the cell to fit inside.
this.gridDataBoundGrid1.Model.ColWidths.ResizeToFit( GridRangeInfo.Col(2) ); // resizes column 2

FYI, you can also set the column widths manually for any particular column,like in the code below,
this.gridDataBoundGrid1.Model.ColWidths[2] = 75; // setting the column width for column2

Regards,
Rajagopal

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.

Warning Icon 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.Close Icon

;