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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

StrongTypedCollection and column captions

Thread ID:

Created:

Updated:

Platform:

Replies:

48801 Sep 5,2006 01:51 AM UTC Sep 5,2006 03:48 PM UTC WinForms 2
loading
Tags: GridControl
Dmitry Bakuntsev
Asked On September 5, 2006 01:51 AM UTC

Hi,

I''m trying to figure out a way to provide a strong typed collection as a datasource to a GGC, and set column captions to values other than property names. Is it possible to do that with attributes (e.g. [System.ComponentModel.DisplayName("abc")]) or anything else at compile time?

Regards,
Dmitry.

Administrator [Syncfusion]
Replied On September 5, 2006 05:03 AM UTC

Hi Dmitry,

Use the HeaderText property of the GridColumnDescriptor to change the display text of the column header cell. Below is a code snippet.

//For main table.....
//Propertygrid and click TableDescriptor=>Columns[0]=>HeaderText=>"Type the name here"; //through Designer...

this.grid.TableDescriptor.Columns[0].HeaderText = "Column1"; //through Code

//For any table....
GridTableDescriptor gd = this.grid.GetTableDescriptor("MyTable"); //Code
gd.Columns["Col1"].HeaderText = "Column1";

Thanks,
Haneef

Dmitry Bakuntsev
Replied On September 5, 2006 03:48 PM UTC

Thanks, Haneef.

The situation with strong typed collection datasources is slightly more complicated in my case. In fact, I compile those collections at runtime, therefore there''s no "design time" involved with respect to the grid and strong typed collection together.

My question was if there''s anything that can provide the grid with some metadata for a compiled class (similarly to [Browsable(false)] on a property) that can instruct the grid to change column captions.

If that''s not possible (which is a pity, I might add), what''s the best way to traverse a hierarchical GGC and remap column captions (provided that I have the mapping stored somewhere, and I simply need to locate all tables and all columns). The hierarchy normally has two levels.

Off topic, what was the reasoning behind making GGC to support homogeneous hierarchies only? My hierarchy is heterogeneous, and I had a blast yesterday trying to figure out how to hide extra tables.

Regards,
Dmitry.

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

;