Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Manasa 80 posts 201 karma points
    May 05, 2014 @ 11:24
    Manasa
    0

    Retrieving data related to inherited properties

    Hi,

    I'm stuck in retrieving data for inherited properties from database.I'm using SQL query to retrieve data and able to get data related to child nodes like the custom properties related to child nodes. When it comes to retrieving data related to properties that child node inherits from its parent nodes, I'am stuck. Please help. Is there any other option of retrieving data.

     

    Thanks

    Manasa

  • Charles Afford 1163 posts 1709 karma points
    May 05, 2014 @ 17:00
    Charles Afford
    0

    Hi could you tell us what you are trying to do and why you are trying to go throught the database rather than the API? 

    Charlie :)

  • Manasa 80 posts 201 karma points
    May 06, 2014 @ 08:53
    Manasa
    0

    Hi Charlie,

    I'm new to umbraco,so accessed properties data via database. Could you please guide me how could I retrieve data using Umbraco API.

    Thanking You

  • Manasa 80 posts 201 karma points
    May 06, 2014 @ 09:00
    Manasa
    0

    I'm using .net user control to generate report for user contacts. Using content picker to select parent node and later properties are displayed where we select required properties of child nodes.Below is the example:

    Contacts

       -->A-->Anil

      -->B-->Bharath

            -->Bhargavi

    If i select Contacts from content picker, properties of child nodes i.e; anil is displayed (as properties are same for all remaining child nodes).

    From dropdown i select A or B,based on that report is generated - details of children and properties selected previously.Using SQL database to retrieve data.

    Now i'm stuck like Anil is inheriting properties from contacts and A , retrieveing data is difficult. Please guide me

    Thanks

  • Manasa 80 posts 201 karma points
    May 06, 2014 @ 13:57
    Manasa
    0

                        Node n = new Node(nodeId);

                        List<string> list = new List<string>();

                        foreach (Node a in n.ChildrenAsList)

                        {

                            foreach (var property in a.PropertiesAsList)

                            {

                                var p = from c in n.ChildrenAsList select a.GetProperty(property.Alias).Value;

                                foreach (string prop in p)

                                {

                                    list.Add(prop);

                                }

                            }

                        }

                        GridView2.DataSource = list;

                        GridView2.DataBind();

    I'm using this. But i get all data repeated twice. Please help me where is the mistake.

    Thanks

  • Manasa 80 posts 201 karma points
    May 06, 2014 @ 14:55
    Manasa
    0

    I solved above problem.

     Node n = new Node(nodeId);

                        List<string> list = new List<string>();

     

                        foreach (Node a in n.ChildrenAsList)

                        {

                            foreach (var property in a.PropertiesAsList)

                            {

                                list.Add(a.GetProperty(property.Alias).Value);

                            }

                        }

                        GridView2.DataSource = list;

                        GridView2.DataBind();

    but problem now is 

     

    I wanted to get property names above and below its corresponding data. Please help.

     

    Thanks,

    MAnasa

  • Charles Afford 1163 posts 1709 karma points
    May 07, 2014 @ 10:20
    Charles Afford
    0

    Hi Manasa sorry been busy having a look now.

    What is the problem with data you are currently getting?

    Thanks

    Charlie

  • Manasa 80 posts 201 karma points
    May 07, 2014 @ 12:00
    Manasa
    0

    Hi Charlie,

    I'm able to retrieve data.but i wanted to display properties based on properties which i select.

    The process i follow is :

    1. Initially we select parent from content picker.Suppose selected node is contacts as shown above

    2.Based on that,its correspoding grandchild nodes properties arediaplyed in checkbox.The checked properties are saved in config file.

    3.A dropdown with the parent node children are dispalyed like A,B and user selects appropriately.

    4.Based on properties selected and node selected from dropdown,data is retrieved and displayed in gridview.

    I'm retrieving all properties data in gridview but how can i compare the properties i selected and display only those in grid.I'm stuck here.

     

    Thanks 

    Manasa

  • Charles Afford 1163 posts 1709 karma points
    May 09, 2014 @ 10:26
    Charles Afford
    0

    Hi Manasa,

    I will have a look at this tonight for you

    Charlie

Please Sign in or register to post replies

Write your reply to:

Draft