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.

How can I change the column width ?

Thread ID:





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

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 02:40 AM

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


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.