We are in the process of evaluating the igHierarcgicalGrid, but we have run into a problem. We managed to get it to work with just one level, but when we try to display a childband the grid does not render at all anymore.
We have a simple list of person objects which in turn have a list of appointments.
Could you show how to get the grid to display the persons with their appointments when using the Razor syntax?
We finally got it to work!
We replaced the following line:
.ClientDataSourceType(ClientDataSourceType.JSON) _ .DataSourceUrl(Url.Action("GetAccountList")) _
with:
.DataSource(HierarchicalDatagridInfragisticsJQuery.AccountModels.GetAccountList) _
and it works now.
However, there is a new problem. It seems the features of paging and sorting are not working properly, as the data is not getting refreshed properly. Do we need to implement some sort of paging features in our GetAccountList function to get it to work?
Another question. Is it possible to put images and imagebuttons inside the grid? We would like to be able to add some images depending on a true or false condition of certain columns.
Thanks for the reply.
I have tried your suggestions, but I am still receiving the same error in IE and Firefox just doesn't display the grid at all.
Here is my modified code for the ColumnLayouts:
.ColumnLayouts(Function(layout) layout.[For](Function(x2) x2.Foos) _ .PrimaryKey("FooNumber") _ .ForeignKey("AccountNumber") _ .AutoGenerateColumns(False) _ .Columns(Function(childCol) childCol.[For](Function(x3) x3.AccountNumber).DataType("number").HeaderText("AccountNumber") childCol.[For](Function(x4) x4.FooNumber).DataType("number").HeaderText("FooNumber") childCol.[For](Function(x5) x5.FooName).DataType("string").HeaderText("FooName") End Function) End Function) _
Hi,
The problem appears to be in the fact that you haven't defined the AccountNumber column for your child layout.
Generally speaking, you always need to defined the columns which serve as your primary and foreign key.This means that you need to define the AccountNumber column in the Foos column layout.I tried it but I haven't worked with VB for ages so it didn't work (Razor VB syntax is crazy :D).
Can you please make the correction and pase the Foos layout definiton in your next reply?Thanks in advance!
PS: Note that the allowed column data types are: number, bool, date and string. You used 'int' a couple of times which isn't correct and may cause trouble.
After looking at the samples and playing around with our code some more we still did not manage to get it to work. When running our test in Firefox the grid does not appear at all, but when we run it in IE the following error occurs:
'length' is null or not an object ig.ui.min.js, line 1character 323973.
So I am wondering if we are forgetting something or if there is an error in the script. I have attached our project, so you might have a look at it.
You can check out the igHierarchicalGrid samples at http://samples.infragistics.com/jquery/hierarchical-grid
In some of them (Multiple Levels Multiple Layouts and Row Selectors for example) you can open the Code View section (just below the sample grid)'s "SELECT SAMPLE SOURCE FILE TO VIEW" drop-down.
In there you will notice that there are 2 view pages available (.aspx is with MVC2's Spark view engine and .cshtml is with MVC3's Razor view engine).I think these Razor syntax samples will be exactly what you need.However, if have any problems, please let us know. Cheers and good luck,Borislav