C # Repeater Nesting

Source: Internet
Author: User

<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> &LT;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> &LT;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&gt                ; </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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.