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.
Syncfusion Feedback

How can I change the column width ?

Thread ID:

Created:

Updated:

Platform:

Replies:

23925 Jan 25,2005 07:18 AM UTC Jan 25,2005 07:40 AM UTC Windows Forms 1
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On January 25, 2005 07:18 AM UTC

I use like this : this.grdDateNames.AllowResizeToFit =false; this.grdDateNames.Model.ColWidths[0] = 250;//this.grdDateNames.Width; grdDateNames.DataSource = dateNameVO.DateNameTable; this.grdDateNames.Model.ColStyles["name"].DropDownStyle = GridDropDownStyle.Editable; GridBoundColumn gbcDateName; gbcDateName = this.grdDateNames.Binder.InternalColumns[DateNameVO.colName]; gbcDateName.StyleInfo.CellValueType = typeof(string); gbcDateName.StyleInfo.BorderMargins.Left =60; gbcDateName.StyleInfo.HorizontalAlignment = GridHorizontalAlignment.Left; But it neither resizes the column nor shows the data. Please show me how to solve this problem.

Administrator [Syncfusion]
Replied On January 25, 2005 07:40 AM UTC

>>this.grdDateNames.Model.ColWidths[0] 0 is the row header column. Is that the column whose width you are trying to set? Try setting the width on col 1 to see if that has an effect. >>this.grdDateNames.Model.ColStyles["name"].DropDownStyle In a GridDataBoundGrid, you use the GridBoundColumn.StyleInfo to set column styles, not the ColStyles collection. So, try setting these styles on the GridBoundColumn. You access teh GridBoundColumns through the grid.Binder.InternalColumns collection only if you have not explicitly added GridBoundColumns to the grid.GridBoundColumns collection either through the designer or through code.

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

;