iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Do you have an example of how to bind to the child grid in the code behind page. I have 2 different data sets, one for the parent table and one for the child table in the webgrid. How do I bind to the child table in the code behind page? This is what I have for the parent table it works, but the child table is not loaded...
WebGrid1.DataBind();
Hi Jocelyn,
We have some sample for hierarchical mode on server side. You can find it in WebGrid's Tutorials. Kindly go to Intersoft WebUI Studio > WebUI Studio for ASP.NET > WebGrid > C# Tutorial. There are some sample that may be useful for your need, e.g in folder V3.1 > LoadOnDemand.aspx, or V4.0 > BindingHierarchicalObjects_LoadOnDemand.aspx. I hope this sample can help you.
One more thing, the best way to bind the grid is in OnInitializeDataSource event and using
e.DataSource = "your database". We didn't recommended to use WebGrid.DataSource and WebGrid.DataBind.
Regards,
Julia
I am sorry but it's not possible to use different dataset for parent and child in hierarchical WebGrid because there will be no relation between parent and child table.
Ok, so if I return one Dataset with all my data. It still does not work. I have Hierarchical
WebGrid1.DataSource = LoadData(); WebGrid1.DataBind();
Hope this helps you out. I cut and pasted it from something I was working on. Let me know if it doesn't work.
namespace WebApplication4 { public partial class _Default : System.Web.UI.Page { DataSet dsFedApps; protected void Page_Load(object sender, EventArgs e) { DataSet dsAppList = new DataSet(); dsAppList.Tables.Add(AppTableAdapter.GetData()); dsAppList.Tables.Add(PropTableAdapter.GetData(0)); DataRelation rel; rel = new DataRelation("relAppProps", dsAppList.Tables["AppList"].Columns["FedAppsID"], dsAppList.Tables["PropList"].Columns["FedAppsID"]); dsAppList.Relations.Add(rel); } protected void WebGrid1_InitializeDataSource(object sender, ISNet.WebUI.WebGrid.DataSourceEventArgs e) { e.DataSource = dsFedApps; WebGrid1.DataMember = "AppList"; WebGrid1.RootTable.DataMember = "AppList"; } protected void WebGrid1_PrepareDataBinding(object sender, ISNet.WebUI.WebGrid.DataSourceEventArgs e) { if (!Page.IsPostBack) { WebGrid1.ClearCachedDataSource(); WebGrid1.RetrieveHierarchicalStructure(); } } } }
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname