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é