hi
following is my requirement
i want to only pull from the server expanded information when a row is expanded. If the row is collapsed then we needed load that information until it is needed.
this is my code which is using to bind the web hierarchical data grid
//parent SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["pubsConnectionString"].ToString()); SqlDataAdapter adp = new SqlDataAdapter("SELECT [au_id], [au_lname], [au_fname], [phone], [address], [city], [state], [zip], [contract] FROM [authors]", con); DataSet ds = new DataSet(); adp.Fill(ds); //child SqlDataAdapter adp1 = new SqlDataAdapter("SELECT [au_id], [au_ord], [title_id], [royaltyper] FROM [titleauthor]", con); DataSet ds1 = new DataSet(); adp1.Fill(ds1); Infragistics.Web.UI.DataSourceControls.DataView dvParent = new Infragistics.Web.UI.DataSourceControls.DataView(); dvParent.ID = "PARENT"; dvParent.DataSource = ds; Infragistics.Web.UI.DataSourceControls.DataView dvChild = new Infragistics.Web.UI.DataSourceControls.DataView(); dvChild.ID = "CHILD"; dvChild.DataSource = ds1; WebHierarchicalDataSource hdsMain = new WebHierarchicalDataSource(); //Adding views to WebHierarchicalDataSource hdsMain.DataViews.Add(dvParent); hdsMain.DataViews.Add(dvChild); //Defining relation. Infragistics.Web.UI.DataSourceControls.DataRelation drMain = new Infragistics.Web.UI.DataSourceControls.DataRelation(); drMain.ParentDataViewID = "PARENT"; drMain.ChildDataViewID = "CHILD"; drMain.ParentColumns = new string[] { "au_id" }; drMain.ChildColumns = new string[] { "au_id" }; hdsMain.DataRelations.Add(drMain); WHG.DataKeyFields = "au_id"; WHG.DataSource = hdsMain; WHG.DataBind();
please provide me sample code for the above requirement if it is possible
thanks
srikanth
Hi srikanth,
As far as I can understand you want to load the data for each expanded node in your WebHierarchicalDataGrid when a node is expanded, i.e. in a LoadOnDemand fashion.
The default binding depth of the hierarchical grid is 0, hence if you want full load on demand you can use the default configuration of the grid.
You can find more information about the LoadOnDemand features of the WebHierarchicalDataGrid here:
http://help.infragistics.com/Help/NetAdvantage/ASPNET/2010.1/CLR3.5/html/WebHierarchicalDataGrid_Load_On_Demand.html
Please contact me if you have any questions.
Petar IvanovDeveloper Support EngineerInfragistics, Inc.http://ko.infragistics.com/support