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.

FieldDescriptor vs ColumnDescriptor

Thread ID:

Created:

Updated:

Platform:

Replies:

16638 Jul 21,2004 07:28 AM Jul 21,2004 11:03 AM Windows Forms 3
loading
Tags: Grouping
Daniel Chait
Asked On July 21, 2004 07:28 AM

what is the difference between FieldDescriptor and GridColumnDescriptor? i.e. gridGroupingControl1.TableDescriptor.Fields and gridGroupingControl1.TableDescriptor.Columns ? - Daniel

Daniel Chait
Replied On July 21, 2004 08:44 AM

More specifically, when I call gridGroupingControl1.TableDescriptor.Fields.Add("CalculatedPrice.Value"); it doesn''t change the table''s appearance, as expected. However when I call: gridGroupingControl1.TableDescriptor.Columns.Add("CalculatedPrice.Value"); It removes all the columns from the table and just adds that one.

Administrator [Syncfusion]
Replied On July 21, 2004 09:03 AM

Hi Daniel, regarding your sample: Before you add gridGroupingControl1.TableDescriptor.Columns.Add("CalculatedPrice.Value"); do int count = gridGroupingControl1.TableDescriptor.Columns.Count; // forces auto population gridGroupingControl1.TableDescriptor.Columns.IsModified = true; // forcess keeping all auto-populated columns That way you signal the grid that you want to keep the auto-populated set of columns as it is and start modifying the collection. If it is not marked modified the columns collections assumes you do not want to keep the auto-populated set of columms. Once the columns collection was marked modified it will not autopopulate any more. You will need to manually add fields to the columns collection after that. Check out the GridTableDescriptor overview in class reference. (Should be at ms-help://Syncfusion.EssentialSuiteClassRef/Syncfusion.EssentialSuiteClassRef/Syncfusion.Grid.Grouping~Syncfusion.Windows.Forms.Grid.Grouping.GridTableDescriptor.html) The Fields collection is auto-populated from the underlying sourcelists columns. Normally you will not modify this collection and just use it in its default auto-populated state. A fieldDescriptor holds a name, mapping name and type of the column in the list. The Columns collection lets you specify the fields that should be displayed in the GridTableControl. By default the Columns collection is auto-populated from the underlying Fields and ExpressionFields collection and will be a combination of this two collection. When the Columns collection is autopopulated and you make changes to the Fields or ExpressionFields collection this changes will automatically be reflected in this collection. GridColumnDescriptors in the Columns collection have a reference to a FieldDescriptor (or ExpressionFieldDescriptor). Additionally GridColumnDescriptors contain grid-specific information about a column such as the column width. You can manually set the column width or have it be automatically initialized by the grid to fit the string with the maximum length in the columns data. GridColumnDescriptor also has a Appearance property. This is where cell type and formatting of the column can be specified. Stefan

Daniel Chait
Replied On July 21, 2004 11:03 AM

Thanks for the overview.

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.

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.

;