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
close icon

adjusting column width with hierachical GridDataBoundGrid

Hello, I am have been unable to successfully change column widths with my 3-level hierachy grid. I am using InternalColumns. I am using DataTables and DataSets as a data source. Snippet: ------- GridHierarchyLevel level0 = gridDataBoundGrid1.Binder.RootHierarchyLevel; level0.InternalColumns[1].MappingName = "test"; gridDataBoundGrid1.Model.ColWiths["test"]= 250; ------- I would expect this to set the column width of the second column to 250. It does not. Changing the index or mapping name does not change any of the column widths. What am I doing wrong? Thanks, Nick

2 Replies

AD Administrator Syncfusion Team June 22, 2006 06:41 PM UTC

Hi Nick, In general grid should automatically resize columns to fit cell contents on first disply of the data. To turn off the this behavior, you need to set the AllowResizeToFit property to false. Please find the code snippet below. this.gridDataBoundGrid1.AllowResizeToFit = false; Let me know if this helps. Best Regards, Haneef


NM Nick M June 22, 2006 08:51 PM UTC

That did it...thanks!

Loader.
Live Chat Icon For mobile
Up arrow icon