C1TreeView for WinForms | C1TreeColumn - DisplayFieldName Property

Posted by: yonit.chavshosh on 29 January 2019, 3:45 am EST

    • Post Options:
    • Link

    Posted 29 January 2019, 3:45 am EST

    Hello,

    I have recursive list. each node includes an object with some properties that are part of the node.

    I want to view these properties as they are the node’s property, not in a sub node .

    For example :

    List=new List();

    Class Shape

    {

    string Name;

    int NumOfRibs;

    Point CenterPoint;

    List Descendents;

    public Shape()

    {

    Descendents=new List();

    }

    }

    Class Point

    {

    int X;

    int Y;

    }

    I want X and Y to be in the Row of Shape

    What I have to write in DisplayFieldName of their columns?

    Thanks,

    Yonit

  • Posted 30 January 2019, 7:40 am EST

    Hello Yoni,

    As per my understanding, you want to show the data in Hierarchical way. To achieve the same you can refer to the following documentation link:

    https://help.grapecity.com/componentone/NetHelp/treeviewwin/webframe.html#BindingTreeViewtoHierarchicalData.html

    Also, you can refer to the product sample located at “C:\Users\MohitG\Documents\ComponentOne Samples\WinForms\C1TreeView\CS\BoundModeWithBindingList”

    If I am missing something, could you please explain in detail.

    Thanks.

  • Posted 31 January 2019, 3:50 am EST

    Hi,

    Thanks for replying,

    But my problem is that I want to view Point not as Hierarchical Data but as part of my data

    and the descendents shapes are Hierarchical Data.

    how can I do that property of Point will be viewed in the same row of shape properties.

    like that,

    each shape node will has these columns:

    Name |NumOfRibs |center X| center Y

    and the descendents shapes will be nodes of this node.

    Name and NumOfRibs are simple to do

    C1TreeColumn c= new C1TreeColumn {

    HeaderText="Name "

    DisplayFieldName="Name "

    }

    but how I can I set ‘Center X’ column??

    It is not a property of shape

    It is a property of Point that is included in Shape.

    Thanks for help,

    Yonit

  • Posted 1 February 2019, 5:37 am EST

    Hello Yoni,

    Could you please try after setting the following property:

    
    C1TreeColumn c= new C1TreeColumn {
    HeaderText="center X"
    DisplayFieldName="\\\\X"
    }
    
    

    Same thing is implemented in the prvious recommned sample(BoundModeWithBindingList). You, could also refer to it.

    Thanks.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels