<tableclass="table table-bordered table-fixed"> <thead> <tr> <th width=" +"> <input type="checkbox"Id="Chkall"onclick="SelectAll ()"/></th> <th width=" -" class="Text-center"><%=Resources.Asset.DictViewRowIndex%></th> <th width="280"><%=Resources.Asset.UserDepartments%></th> <th width=" -"><%=Resources.Asset.AssetCategory%></th> <th width=" -"><%=Resources.Asset.AssetSubClass%></th> <th width=" -"><%=Resources.Asset.AssetsCompany%></th> <th width=" -"><%=Resources.Asset.AssetName%></th> <th width=" the"><%=Resources.Asset.AssetsState%></th> <th width=" -"> Quantity </th> <th width=" -"> Original value </th> </tr> </thead> <tbody> <asp:repeater id="rptdept"runat="Server"Onitemdatabound="Rptdept_itemdatabound"> <ItemTemplate> <tr> <td> <input type="checkbox" class="AssetID"Id='<%# ((iWS.Assets.DB.Asset) Container.DataItem). Id%>'onclick="Selectsingle ();"/></td> <TDclass="Text-center"><%# Container.itemindex +1+ ( This. Pagercontrol.currentpageindex-1) * This.pagercontrol.pagesize%></td> <td><%# ((iWS.Assets.DB.Asset) Container. DataItem). owner!=NULL? ((IWS.Assets.DB.Asset) Container.DataItem). Owner.depts:""%></td> <TD colspan="7"style="padding:0;"> <table style="border:none; width:100%;"> <asp:repeater id="rptdeptsub"runat="Server"> <ItemTemplate> <tr> <td><%# (IWS.Assets.DB.Asset) container.datait EM). maincategory!=NULL? ((IWS.Assets.DB.Asset) Container.DataItem). Maincategory.name:""%></td> <td><%# ((iWS.Assets.DB.Asset) Container.da Taitem). subcategory!=NULL? ((IWS.Assets.DB.Asset) Container.DataItem). Subcategory.name:""%></td> <td><%# ((iWS.Assets.DB.Asset) Container.da Taitem). Company%></td> <td><%# ((iWS.Assets.DB.Asset) Conta Iner. DataItem). Name%></td> <td><%# ((iWS.Assets.DB.Asset) containe R.dataitem). state!=NULL? ((IWS.Assets.DB.Asset) Container.DataItem). State.name:""%></td> <td><%# ((iWS.Assets.DB.Asset) Container.da Taitem). Number%></td> <td><%# ((iWS.Assets.DB.Asset) Contai Ner. DataItem). Cost%></td> </tr> </ItemTemplate> </asp:Repeater> </table> </td> </tr> </ItemTemplate> </asp:Repeater> </tbody> ; </table>
protected voidRptdept_itemdatabound (Objectsender, System.Web.UI.WebControls.RepeaterItemEventArgs e) { Try { if(E.item.itemtype = = ListItemType.Item | | e.item.itemtype = =ListItemType.AlternatingItem) {Repeater Rep= E.item.findcontrol ("rptcarryovermsgsub") asRepeater;//Locate the Repeater objectDataRowView ROWV =(DataRowView) e.Item.DataItem; stringFINA = rowv["Finacialcode"] +"";//gets the associated process ID stringproj = rowv["ProjName"] +"";//gets the associated process ID stringYewu = rowv["Yewusuo"] +"";//gets the associated process ID varquery = fromRinchcarryoverdt.asenumerable ()wherer.field<string> ("Finacialcode"). Equals (FINA) && r.field<string> ("ProjName"). Equals (proj) && r.field<string> ("Yewusuo"). Equals (YEWU)Select New{carryovername= r.field<string> ("Carryovername"), account= r.field<decimal> (" Account"), Subdebt= r.field<decimal> ("subdebt"), Totalincome= r.field<decimal> ("Totalincome"), Historyincome= r.field<decimal> ("Historyincome"), Currentincome= r.field<decimal> ("Currentincome"), Lastcarryovertocurrentincome= r.field<decimal> ("Lastcarryovertocurrentincome"), Totalcarryover= r.field<decimal> ("Totalcarryover"), Historycarryover= r.field<decimal> ("Historycarryover"), Currentcarryover= r.field<decimal> ("Currentcarryover"), Currentfinalbalance= r.field<decimal> ("currentfinalbalance"), Currentoutcome= r.field<decimal> ("Currentoutcome"), Outcomecancarryover= r.field<decimal> ("Outcomecancarryover"), Progess= r.field<int> ("progess"), Progresscancarryover= r.field<decimal> ("Progresscancarryover"), Thiscarryover= r.field<decimal> ("Thiscarryover") }; DataTable DT=datatablehelper.todatatable (query. ToList ()); Rep. DataSource=DT; Rep. DataBind (); } } Catch(Exception ex) {Disklog.logerror ("Implementasyncdata-rptachivedata_itemdatabound", ex); } }
C # Repeater nesting