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?
Hello, actually what is happening is i am passing data from my controller as json to ajax in javascript,i am getting parent list data on grid but i am unable to see child grid
Hello,
The child structure is not visible because if there is no data, child grids are not rendered. Additionally, regarding the error message could you please provide a small isolated sample, reproducing the described behavior. Remove any external dependencies and code that is not directly related to the issue, zip your application and attach it in this case.
Having a working sample on my side, which I can debug, is going to be very helpful in finding the root cause of this behavior.
Thank you for your cooperation.
Regards, Monika Kirkova, Infragistics
Below is my code:it only load first column, i am not able to see the structure of child columns.Note: i am not passing any data yet, i just want to see the column structure@{ IQueryable<abc> employees = new List<abc>().AsQueryable(); }
@(Html.Infragistics().Grid(employees) .ID("gridDroppedRecord") .AutoGenerateColumns(false) .Width("100%") .AutoGenerateLayouts(false) .FixedHeaders(true) .Columns(column => { column.For(x => x.Action).HeaderText("Actions") .Template( "<a href='javascript:void(0);' class='btn-delete-employee' onclick=\"deleteEmployee('${EncryptedIncompleteUploadedEmployeeId}')\" onmouseover='javascript: InfoToolTip(this)' title='Delete'><i class='icon icon-delete' aria-hidden='true'></i></a>" + "{{/if}}").Width("100px"); column.For(x => x.UploadDate).DataType("date").HeaderText("Uploaded On").Width("140px"); column.For(x => x.EmployeeName).DataType("string").HeaderText("Employee Name").FormatterFunction("getName").Width("175px"); column.For(x => x.EmployeeCode).DataType("string").HeaderText("Employee ID").FormatterFunction("getEmployeeCode").Width("700px");
}) .ColumnLayouts(layouts => { layouts.For(x=>x.DroppedRecordList)
.AutoGenerateColumns(false) .AutoGenerateLayouts(false) .Columns(childcol => { childcol.For(x => x.HiredDate).DataType("date").HeaderText("Hire Date").Width("100px"); ; childcol.For(x => x.DivisionName).HeaderText("Division Name").Width("100px"); ; childcol.For(x => x.EmployeeType).HeaderText("Employee Type").Width("100px"); ; });
}) .DataBind() .Render()
Hi,Thanks you so much for helping me out.I tried the exact same method but i am getting one error on model.it is conversion errorcan you please help me
The igHierarchicalGrid can render only a hierarchical data source and in order to render the grid correctly the data should look as follows:
private IEnumerable<Customer> GetCustomers()
{
return new List<Customer>
new Customer { CustomerID=1, CompanyName="Company1", ContactName="John Smith", Country="USA", City="Los Angeles", Orders= new List <Order>
new Order { OrderID = 101, CustomerID = 1, ShipName="Ship11", ShipAddress="Australia" },
new Order { OrderID = 102, CustomerID = 1, ShipName = "Ship12", ShipAddress = "USA" },
new Order { OrderID = 103, CustomerID = 1, ShipName = "Ship13", ShipAddress = "Germany" }, }
},
. . .
};
}
Below I am attaching a sample, demonstrating binding igHierarchicalGrid to data. Please test it on your side and let me know if you need any further information regarding this matter.
igHierarchicalGrid.zip