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

Syncfusion Grid Grouping Controls, Column width setting/Resizing Problem

Thread ID:

Created:

Updated:

Platform:

Replies:

42666 Apr 4,2006 11:42 AM UTC Apr 7,2006 06:10 AM UTC Windows Forms 3
loading
Tags: GridControl
Rahul Sharma
Asked On April 4, 2006 11:42 AM UTC

I am working with Syncfusion "Grid Grouping Control datagrid" , I have a dataset which contains table dynamically. I set the default view of the table of datset to the Syncfusion Datagrid Datasource property, but the Columns displayed say four columns of Table(0) doesn’t fill the whole grid. So, I wish to Know 1) How to set the width of a column present in a datagrid without using Grid Column Descriptor 2) How to make Columns width resizable to fit the datagrid in any resizing of the from 3) If this can’t happen without Grid Column Descriptor, please tell me how to use “Grid Column Descriptor” 4) Please see below, I want the four column width should sum up the width of datagrid Datgrid ---------------------------------------------------------------- Column1 | column2| column3| column4|

Administrator [Syncfusion]
Replied On April 4, 2006 03:42 PM UTC

Hi Rahul, One comment is that by default, the GridGroupingControl does not support rows with individualized rowheights. To get this support, you need to add a custom GridEngine as in the SyncfusionBrowser sample C:\Program Files\Syncfusion\Essential Suite\Grouping\ResizableRows Once you have this,the code below helps you in changing the column width for column 2 this.gridGroupingControl1.TableControl.Model.ColWidths[2] = 100; To resize all the columns, this.gridGroupingControl1.TableControl.Model.ColWidths.ResizeToFit(GridRangeInfo.Table()); Let us know if you need more information. Thanks, Rajagopal

Rahul Sharma
Replied On April 5, 2006 11:50 AM UTC

1) I m having a tree view and a datagrid. My task is to fill datagrid as per the item selected in tree view. 2)After assinging datasource to datgrid, I am setting width of columns as per table fetched from dataset. 3) It works perfect with very first table, but when the dataset again gets filled with another table having different numbers of columns it gives error "System.ArgumentOutOfRangeException at "Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptor.get_Item(Int32 index)"" 4)For same tables with same no. of column as per first, columns are coming as per width but empty Code Snippet ''Get Table as Per Selected Tree Node dsLoadAssetToGrid = clsSqlDatabase.GetDataSetFromStoredProcedure(cmdLoadAssetToGrid) dgAssetLocator.DataSource = dsLoadAssetToGrid.Tables(0).DefaultView ''Set The width of the Columns per Datagrid Width For intColumns = 0 To dsLoadAssetToGrid.Tables(0).Columns.Count - 1 ''Giving Error On this Line dgAssetLocator.TableDescriptor.Columns(intColumns).Width = dgAssetLocator.Width / dsLoadAssetToGrid.Tables(0).Columns.Count Next

Administrator [Syncfusion]
Replied On April 7, 2006 06:10 AM UTC

Hi Rahul, Sorry for the delayed response. After setting the new data source try calling dgAssetLocator.TableDescriptor.ResetColumns() to see if that helps. ''Get Table as Per Selected Tree Node dsLoadAssetToGrid = clsSqlDatabase.GetDataSetFromStoredProcedure(cmdLoadAssetToGrid) dgAssetLocator.DataSource = dsLoadAssetToGrid.Tables(0).DefaultView dgAssetLocator.TableDescriptor.ResetColumns() .......... ............ ............... Regards, Calvin.

CONFIRMATION

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.

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

;