Hi,
I tried all possible combinations to set the column width, but none seems to work.
I am creating the columns dynamically by a stored procedure.
Following are the methods are I tried:
//METHOD 1
this.GridGroupingControl1.TableDescriptor.Columns[1].MaxLength = 10;
//METHOD 2
for (int i = 0; i < this.GridGroupingControl1.TableDescriptor.Columns.Count; i++) this.GridGroupingControl1.TableDescriptor.Columns[i].Width = 20;
//METHOD 3
this.GridGroupingControl1.TableDescriptor.Columns[1].MaxLength = 10; this.GridGroupingControl1.TableOptions.ColumnsMaxLengthStrategy = GridColumnsMaxLengthStrategy.MaxLengthSummary;
//METHOD 4
this.GridGroupingControl1.TableOptions.DefaultColumnWidth = 10;
//METHOD 5
GridColumnDescriptor gcd = this.GridGroupingControl1.TableDescriptor.GetColumnDescriptor("myColumn");
gcd.Width = 20;
This is my design time defn of Gridgrouping control:
ShowGroupDropArea="False" BorderCollapse="Separate" OnQueryCellStyleInfo="cControl_QueryCellStyleInfo" OnQueryCoveredRange="cControl_QueryCoveredRange" EnablePostbacks="false" TableDescriptor-AllowEdit="false" TableOptions-AllowDragColumns="false" Width="400"
TableOptions-AllowSortColumns="false" ReadOnly="true" TableDescriptor-AllowColumnResize="false">
Please advise.
Thanks