创建第二级子网格。按照示例(子网格(2个嵌套级别)) [的jqGrid] http://www.trirand.net/demoaspnet.aspx 当单击父网格的行(+)符号时,它只显示一个空行下面没有列名,所以我认为,它甚至没有在客户端上加载子网格。 任何想法PLZ? >
********** aspx页面:****************
< cc1:JQGrid ID =“Jqgrid1”runat =“server”OnDataRequesting =“Jqgrid1_DataRequesting”>
< SortSettings InitialSortColumn =“”/>
<柱体和GT;
< cc1:JQGridColumn DataField =“PrimaryId”PrimaryKey =“True”>
< / CC1:JQGridColumn>
< cc1:JQGridColumn DataField =“ContractNumber”> < / CC1:JQGridColumn>
< cc1:JQGridColumn DataField =“PONumber”>
< / CC1:JQGridColumn>
< cc1:JQGridColumn DataField =“POLineNumber”>
< / CC1:JQGridColumn>
< cc1:JQGridColumn DataField =“Description”>
< / CC1:JQGridColumn>
< /柱体和GT;
< ClientSideEvents SubGridRowExpanded =“showSubGrid”/>
< HierarchySettings HierarchyMode =“Parent”/>
< / CC1:的jqGrid>
< / DIV>
< cc1:JQGrid ID =“Jqgrid2”runat =“server”OnDataRequesting =“Jqgrid2_DataRequesting”>
< SortSettings InitialSortColumn =“”/>
<柱体和GT;
< cc1:JQGridColumn DataField =“BOMKEY”PrimaryKey =“True”HeaderText =“BKey”>
< / CC1:JQGridColumn>
< cc1:JQGridColumn DataField =“PARTNUMBER”HeaderText =“Part#”>
< / CC1:JQGridColumn>
< cc1:JQGridColumn DataField =“DESCRIPTION”HeaderText =“Desc”>
< / CC1:JQGridColumn>
< /柱体和GT;
< HierarchySettings HierarchyMode =“Child”/>
< / CC1:的jqGrid>
< script type =“text / javascript”>
function showSubGrid(subgrid_id,row_id) { showSubGrid_Jqgrid2(subgrid_id,row_id); }
*****代码背后的******代码 protected void Jqgrid1_DataRequesting(object sender,> Trirand.Web.UI.WebControls.JQGridDataRequestEventArgs e)
{
if(!LoadPurchaseOrderLineDataSet())
{返回; }
Jqgrid1.DataSource = dtPurchaseOrderLine;
Jqgrid1.DataBind();
}
protected void Jqgrid2_DataRequesting(对象发送者,Trirand.Web.UI.WebControls.JQGridDataRequestEventArgs e)
{
LoadPurchaseOrderBOMDataSet(e.ParentRowKey);
Jqgrid2.DataSource = dsPurchaseOrderBOM;
Jqgrid2.DataBind();
}
答案 0 :(得分:1)
我找到了解决方案 - “主键不应包含任何特殊字符”。