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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Cannot Minimize column size

Thread ID:





10047 Jan 21,2004 12:27 PM UTC Jan 21,2004 12:43 PM UTC WinForms 1
Tags: GridControl
Administrator [Syncfusion]
Asked On January 21, 2004 12:27 PM UTC

Hi, I filled a ds with dataadaptor and then use the table as the datasource for the databoundgrid. I would like to remove the most left column which has nothing and not even part of my table. I used similar codes I used earlier to set column[0]=0 but it does not work. Did I do something wrong? Thanks for the help Chris SqlDataAdapter da; DataSet ds = new DataSet("myData"); string sql = ... //Initialize data adapter da = new SqlDataAdapter(sql,dbConn); int i = da.Fill(ds); this.gridDataBoundGrid1.DataSource = ds.Tables[0]; this.gridDataBoundGrid1.EnableEdit=false; this.gridDataBoundGrid1.Model.ColWidths.ResizeToFit(GridRangeInfo.Rows(0, 2), GridResizeToFitOptions.IncludeHeaders); /minimize the index column this.gridDataBoundGrid1.Model.ColWidths[0] = 0;

Administrator [Syncfusion]
Replied On January 21, 2004 12:43 PM UTC

One comment is that ColWidths[0] is actually teh RowHeader column. It is not the first column from your datasource, ColWidths[1] is. Also, you should set this.grid.AllowResizeToFit = false; otherwise, the grid will try to autosize things based on headertext and this can step on your explicit sizing.


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon