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.
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
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
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 :)
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
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
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
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
Hi Manasa sorry been busy having a look now.
What is the problem with data you are currently getting?
Thanks
Charlie
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
Hi Manasa,
I will have a look at this tonight for you
Charlie
is working on a reply...