Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
460
webhierarchical grid and Entity Framework
posted

Good day,

I am trying to get the WebHierarchicalDataGrid working in combination with EDM. In EDM i created an entity called Employees with a primary key on employeeID and an association to itself from ReportsTo to EmployeeID.

In what way can i make the WebHierarchicalDataGrid work? What fields do i need to fill and with what values. I want to do everything in codeBehind.

This is the code I have in the aspx:

Normal 0 21 false false false NL X-NONE X-NONE MicrosoftInternetExplorer4

<ig:WebHierarchicalDataGrid ID="WebHierarchicalDataGrid1" runat="server"

    Height="350px" Width="100%" IsSelfReference="True" /> 

 

And in the codebehind:

protected void Page_Load(object sender, EventArgs e)

{

                List<Employees> result = (List<Employees>)Master.GetEntities().Employees.ToList();

                WebHierarchicalDataGrid1.DataSource = result;

                WebHierarchicalDataGrid1.DataMember = "Employees";

               WebHierarchicalDataGrid1.DataKeyFields = "EmployeeID";

              WebHierarchicalDataGrid1.Key = "Employees";

              WebHierarchicalDataGrid1.InitialDataBindDepth = -1;

              WebHierarchicalDataGrid1.DataBind();

}

As an addition: Trying to make the grid work with the entity framework via the grafical part of the grid also does not work. I can link all my entities fields to parts of the grid, but the data does not show. It looks like the reference to the lower level is not seen by the grid.

Kind regards.

      René

Parents
No Data
Reply
  • 33839
    posted

    Hi René,

    What version and build are you using?  If you are using an RTM build (something 1xxx), then I'd suggest upgrading to the latest Service Release.  Are you trying to define the child bands or let the grid do it?  If you could attach a working sample here showing the problem, that would be much appreciated.  Let me know.

    regards,
    David Young 

Children