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 but it does not work.
Did I do something wrong?
Thanks for the help
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;
this.gridDataBoundGrid1.Model.ColWidths.ResizeToFit(GridRangeInfo.Rows(0, 2), GridResizeToFitOptions.IncludeHeaders);
/minimize the index column
this.gridDataBoundGrid1.Model.ColWidths = 0;
ADAdministrator Syncfusion Team January 21, 2004 07:43 AM
One comment is that ColWidths is actually teh RowHeader column. It is not the first column from your datasource, ColWidths 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.