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é
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
Good morning,
We are using the last build, so upgrading is not an option. The not-working-sample is standing in my first post (above). Could you please help.
regards,
So when you say you are using the last build, I would take that to mean version 10.3 and the latest Service Release (build number 2056 or something). I know there was a fix in the data framework we use for Entity framework after 10.3 originally shipped. It would be in the latest 10.2 release. The code you have in the page load is just sample code, but not a full sample. If you don't have time to make one, I suggest contacting Developer Support. They will work with you to create a sample and submit a bug on your behalf.