Hi All,
Actually i am trying to develop a grid which will show name and id on top and under it will to multiple records for same name and idi want to develop a grid like this.Note: i am fetching all the data from single table only.Can anyone help please?
I am getting the parent row, but i am not able to see child row
@(Html.Infragistics().Grid(Model). ID("grid1")
. AutoGenerateColumns(false)
. AutoGenerateLayouts(false). Height("500px"). Width("700px")
. ResponseDataKey(String.Empty)
. PrimaryKey("CustomerID"). LoadOnDemand(true). Rest(true)
. Columns(column => {
column.For(x => x.CustomerID).HeaderText("Customer ID").DataType("string");
column.For(x => x.CompanyName).HeaderText("Company Name").DataType("string");
column.For(x => x.ContactName).HeaderText("Contact Name").DataType("string");
column.For(x => x.Address).HeaderText("Address").DataType("string");
column.For(x => x.City).HeaderText("City").DataType("string"); }).
ColumnLayouts(layouts => {
layouts.For(x => x.Orders)------>instead i am using "@(Html.Infragistics().Grid(Model). ID("grid1")" because i am fetching from one class only
. ResponseDataKey(String.Empty). Width("100%")
. ForeignKey("CustomerID")
. PrimaryKey("OrderID"). AutoGenerateColumns(false). AutoGenerateLayouts(false)
. Columns(childcolumn => {
childcolumn.For(x => x.OrderID).HeaderText("Order ID").DataType("number");
childcolumn.For(x => x.ShipAddress).HeaderText("Ship Address").DataType("string");
childcolumn.For(x => x.ShipName).HeaderText("Ship Name").DataType("string");
})
Render())What should i do?
Hello,
What I could suggest is using our igHierarchicalGrid component. The igHierarchicalGrid is a control for displaying hierarchical data with multiple levels and multiple layouts (relationships) on the same level. Because the igHierarchicalGrid uses internally the flat igGrid all its features are also available for the igHierarchicalGrid. More information regarding igHierarchicalGrid could be found in the following topic of our documentation.
Additionally, another component which could be used, depending on the requirement is the igTreeGrid. The data, bound to the igTreeGrid, could be hierarchical or could contain a parentId, which could be set as foreign key to the grid. An overview topic of the igTreeGrid could be found here.
Please let me know if you need any further information regarding this matter.
Regards, Monika Kirkova, Infragistics