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. (Last updated on : November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Dynamically designing GridGroupingControl at runtime.

Thread ID:

Created:

Updated:

Platform:

Replies:

54487 Jan 10,2007 06:49 AM UTC Jan 10,2007 09:10 AM UTC WinForms 1
loading
Tags: GridControl
Vinod Shembekar
Asked On January 10, 2007 06:49 AM UTC

Hi,

I want to desing GridGroupingControl at runtime.
The requirements are:
1) Adding columns dynamically.
2) Asigning various properties like width, non-editable etc.
3) Freezing few of the newly added columns.
4) Out of say 100 columns in EntityCollection, I want to bind only 10 columns. i.e how to set "AutogenerateColumns" false?

Waiting for reply.

Thanks and Regards,
Vinod

Administrator [Syncfusion]
Replied On January 10, 2007 09:10 AM UTC

Hi Vinod,

1) Adding columns dynamically.

>>>>>>>> >>>>>>>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
You can make use of Columns property of the GridTableDescriptor to manages(add,remove,move and insert) the columns in the grid. You can use gridGroupingControl1.TableDescriptor.Columns.Add to add the column to the grid and then use gridGroupingControl1.TableDescriptor.Columns.Insert to insert it somewhere else in the collection.

If you want to move columns in the Columns collection, then try using TableDescriptor.Columns.Move.

//move "Col2" to position 2 in the Columns collection
int col4 = gridGroupingControl1.TableDescriptor.Columns.IndexOf("Col4");
gridGroupingControl1.TableDescriptor.Columns.Move(col4, 2);
>>>>>>>> >>>>>>>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

2) Asigning various properties like width, non-editable etc.

>>>>>>>> >>>>>>>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Use the TableDescriptor.Columns["ColumnName"].Width property to set the width of the column in a grid. Here is a code snippet.

gridGroupingControl1.TableDescriptor.Columns[0].Width= 100;

How to specify the columns width to be fixed and non-resizable in a grid
>>>>>>>> >>>>>>>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

3) Freezing few of the newly added columns.

>>>>>>>> >>>>>>>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
The FrozenColumns browser sample (\Essential Studio\4.4.0.49\windows\Grid.Grouping.Windows\Samples\UnderstandingGroupingArchitecture\FrozenColumns\cs ) demonstrates how to freeze the columns in a grid grouping control that is bound to a hierarchical dataset. This feature will allow you to lock specific columns so that they will always be visible on the screen no matter how far you scroll to the right or down.
>>>>>>>> >>>>>>>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

4) Out of say 100 columns in EntityCollection, I want to bind only 10 columns. i.e how to set "AutogenerateColumns" false?

>>>>>>>> >>>>>>>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Please try the attached sample and let me know if you looking something different.
GridSingleColumn.zip
>>>>>>>> >>>>>>>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Best Regards,
Haneef

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

;