Hi all,
I have two questions:
1) I am trying to bind a DataSet returned from a server service method to an igHierarchicalGrid. So I tested it first on the client side by using an xml string directly. The binding of the parent record is ok. However child level binding is failed. I just don't know how to specify child object schema inside parent xml schema or if there is another way. I will attach my sample code. Please let me know how to correct it.
2) If I use ajax call to get the DataSet returned from a web service method, then binding xml data to the control, how do I do binding in this case? say getXml from the xml stream etc.
$.ajax({type: "post",url: "mywebservicemethod",dataType: "xml",success: function(xml) {
//binding data to igHierarchicalGrid
}
thanks so much
Hello bettysun,
Thank you for posting in the community.
I am currently researching your scenario and wil keep you posted of my progress. In the meantime I would suggest that you consider sending your data as json if at all possible. This would make the task of databinding the grid much more straightforward.
Hi Petar,
I tested it with dataType: "json" in ajax call using the same data returned from the webservice method. It's not working. BTW: I have multiple "CustomerInfo" records in the DataSet.
When I debug it, the response.text message is "A circular reference was detected while serializing an object of type \u0027System.Globalization.CultureInfo\u0027.",
xhr.statusText is "Internal Server Error".
It probably is caused by the complex object. The parent/child probably references in a circular way during serialization.
but I don't know what I can do with it.
Thanks,
Betty
Hello Betty,
This issue may be related to the object hierarchy and the JSON serializer itself.
You can check the following posts describing solution to similar issue - http://stackoverflow.com/questions/1153385/a-circular-reference-was-detected-while-serializing-an-object-of-type-subsonic
http://stackoverflow.com/questions/10027756/a-circular-reference-was-detected-while-serializing-an-object-of-type-in-asp-net
Let me know if this is helpful.
Hi Alex,
It is helpful information, I will remove property "CustomerID" in the Children object "Transactions" in order to avoid circular refernce during serialization.
Before I deal with the Server/Client program, can you help me to figure out how I can bind the xml string to the igHierachicalGrid in the attached html file? The parent binding is ok. However, none of the child properties is bound.
Please refer to the attached sample that shows how to bind XML data string to "igHierarchicalGrid".
Test this sample and let me know if it works correctly on your setup.
In your code I see reference: <script src="http://localhost/ig_ui12.1/js/infragistics.loader.js"></script>
and $.ig.loader({ scriptPath: "http://localhost/ig_ui12.1/js/", cssPath: "http://localhost/ig_ui12.1/css/", resources: "igHierarchicalGrid" });
I am using jquery version 2011.1. In which folder I can find these files or do I have to download 2012 version?
Or where can I download all files located in ig_ui12.1 folders.
The sample was created for version 12.1 which is the latest version of our jQuery controls currently available.
Actually “igHierarchicalGrid” was added officially in version 11.2 of our controls - http://help.infragistics.com/NetAdvantage/jQuery/2011.2/CLR4.0?page=Whats_New_In_2011_Volume2.html – and in order to use most of its features you have to download this version or better version 12.1.
You can download version 12.1 from our Website as Trial package (if you do not have Product Key) and use it to test this specific scenario.
In version 12.1 we use new way to load all needed scripts and styles – Infragistics loader. More about Infragistics loader you can read here - http://help.infragistics.com/NetAdvantage/jQuery/2012.1/CLR4.0?page=Using_Infragistics_Loader.html
Download version 12.1, test the sample and let me know if you have further questions.