参考官方Demo : GridPanel -> Data With Details -> One-to-Many
其主要过程为:通过主GridPanel的行RowSelect事件,调用另一个GridPanel的Stone的reload()
主GridPanel的SelectionModel如下:
< ext:RowSelectionModel runat = " server " SingleSelect = " true " >
< Listeners >
< RowSelect Handler = " if (#{pnlSouth}.isVisible()) {#{Store2}.reload();} " Buffer = " 250 " />
</ Listeners >
</ ext:RowSelectionModel >
显示明细数据的GridPanel的Store主要通过注册其OnRefreshData事件来获取对应的数据
<ext:Store ID="Store2" runat="server" DataSourceID="LinqDataSource2" OnRefreshData="Store2_Refresh">
这里Store2_Refresh方法是编写在后台代码里的方法
protected void Store2_Refresh(object sender, StoreRefreshDataEventArgs e)
{
string id = e.Parameters["SupplierID"];
this.LinqDataSource2.WhereParameters["SupplierID"].DefaultValue = id ?? "-1";
this.Store2.DataBind();
}
其EventArgs的Parameters属性对应Store2内的指定的<ext:Parameter>