I used the following code for binding.
I got nothing.
No error/exception. No Result.
-----------------------------------------------------------------------------------------------------------------------------------------------------
protected void LoadData() { SqlDataSource sdsParent = new SqlDataSource(); sdsParent.ConnectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ToString(); sdsParent.SelectCommand = "SELECT TM.TXN_NO AS TXN_NO, TM.FPSHOP_NO, TM.CARD_NO, FD.MEMBERNAME AS MEMBERNAME,FD.UID_NUMBER, TM.TOT_AMOUNT, TO_CHAR(TM.TXN_DATETIME, 'DD-MM-YYYY HH:MI:SS') AS EXPR1, DM.DIST_NAME, MM.MAND_NAME, TM.DEVICE_TXN_NO FROM TRANSACTION_MASTER TM, DIST_MST DM, MAND_MST MM, HH_FAMILYDETAILS FD WHERE DM.DIST_NO = TM.DIST_NO AND MM.MAND_NO = TM.MAND_NO AND MM.DIST_NO = TM.DIST_NO AND FD.HOUSEHOLDCARDNO = TM.CARD_NO AND FD.SLNO = TM.MEMBER_ID ORDER BY TM.TXN_DATETIME DESC"; sdsParent.DataBind(); SqlDataSource sdsChild = new SqlDataSource(); sdsChild.ConnectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ToString(); sdsChild.SelectCommand = "SELECT TXN_NO,COMMODITY_NAME,QTY,TD.PRICE FROM TRANSACTION_DETAILS TD INNER JOIN COMMODITY_MASTER CM ON TD.COMMODITY_CODE=CM.COMMODITY_CODE"; sdsChild.DataBind(); Infragistics.Web.UI.DataSourceControls.DataView dvParent = new Infragistics.Web.UI.DataSourceControls.DataView(); dvParent.ID="PARENT"; dvParent.DataSource="sdsParent"; Infragistics.Web.UI.DataSourceControls.DataView dvChild = new Infragistics.Web.UI.DataSourceControls.DataView(); dvChild.ID="CHILD"; dvChild.DataSource="sdsChild"; Infragistics.Web.UI.DataSourceControls.DataRelation drMain = new Infragistics.Web.UI.DataSourceControls.DataRelation(); drMain.ParentColumns = new string[] { "TXN_NO" }; drMain.ChildColumns = new string[] { "TXN_NO" }; drMain.ParentDataViewID = "PARENT"; drMain.ChildDataViewID = "CHILD"; hdsMain= new Infragistics.Web.UI.DataSourceControls.WebHierarchicalDataSource(); hdsMain.DataRelations.Add(drMain); WebHierarchicalDataGrid1.DataSource = hdsMain; WebHierarchicalDataGrid1.DataKeyFields = "TXN_NO"; Band b1 = new Band(); b1.DataMember = "TXN_NO"; b1.DataKeyFields = "TXN_NO"; WebHierarchicalDataGrid1.Bands.Add(b1); WebHierarchicalDataGrid1.DataBind(); }
Hi awebdesigner09,
It has been a while since your post, however in case you still require assistance I would be glad to help.
I have studied your case and can find nothing wrong with the code you have posted. However, as far as I can see you are setting only your bands in your code-behind.
The most likely reason for you to be getting an empty grid is if you have the AutoGenerateColumns flag of the grid set to false. Setting AutoGenerateColumns to true should resolve the matter.
You can find more information on setting the bands and columns for the WebHierarchicalDataGrid at:
http://help.infragistics.com/Help/NetAdvantage/ASPNET/2011.1/CLR4.0/html/WebHierarchicalDataGrid_Data_Binding.html
Please contact me if you have any questions.
Petar IvanovDeveloper Support EngineerInfragistics, Inc.http://es.infragistics.com/support