Note that there are some explanatory texts on larger screens.

plurals
  1. PORemove Data From a Hierarchy
    primarykey
    data
    text
    <p>Afternoon, I am trying to do something in Silverlight with the EntityFramework and have hit a wall.</p> <p>I am pulling some hierarchical data out of the database and displaying it in a tree view, what I want to do is remove any nodes which do not have a child node and there are no items associated with it (Easy...) but what I am finding is that there are nodes left over, so from the original tree:</p> <pre> Parent 1 -----Node 1 Parent 2 Parent 3 -----Node 2 ---------- Some Items -----Node 3 ---------- Some More Items </pre> <p><p>What I am finding is that Parent 2 is removed (Because it has no children ro items) and Node 1 is removed because it has no children or items... But Parent 1 is left because it HAD child nodes, but these were removed... </p> <p>I dont really want to loop over the reeview as that would be inneficient what I have done is constrain the data that is being bound to the view:</p> <p>Data Structure:</p> <p>HIERARCHY<br /> ~~~~~~~~~~<br /> HierarchyID<br /> Description<br /> ParentID (FK - HierarchyID)<br /></p> <p>Items<br /> ~~~~~<br /> ItemID<br /> Description<br /> Price<br /> HierarchyID (FK - Hierarchy.HierarchyID)<br /></p> <p>I am using something along these lines to constrain the data:</p> <p>var data = from Hierarchy.where(x=>x.Hierarchies.Count > 1 &amp;&amp; x=>x.Items.Count > 0) </p> <p>then data is bound to the treeview.</p> <p>This isnt exactly what we have, some of this is from memory, but it outlines the problem that we are having at the moment, if anyone has any ideas it would be greatly apprectiated</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload