1, work encountered such a demand, the page to all the user load out, while each user followed by the user's task to load out! My approach is to use repeater to load all the user, while in the repeater nested a GridView, the task of each user to display! The code is as follows
Foreground code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
<asp:repeater id= "Repeater1" runat= "server" onitemdatabound= "Repeater1" _itemdatabound "> <HeaderTemplate> <table border=" 0 "cellspacing=" 0 "cellpadding=" 0 "width=" 100% "> < tr> </HeaderTemplate> <ItemTemplate> <td class= "list_table_in" > <span class= " Leadertitle "> Executive: <a href= '/leaderschedule/_layouts/ls/leaderdetail.aspx?loginname=<% #Eval (" loginName ")% > ' ><% #Eval ("UserName")%></a></span><asp:gridview id= "Gv_inrep" runat= "Server" autogeneratecolumns= "False" allowsorting= "True" onrowcreated= "gv_donelist_rowcreated" onsorting= "GV_DoneList_" Sorting "allowpaging=" True "cssclass=" Tasklisttbl "width=" 100% "onrowdatabound=" Gv_donelist_rowdatabound " enablemodelvalidation= "True" > <alternatingrowstyle backcolor= "#FDFEFF"/> |
Background code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 The |
protected void Repeater1_itemdatabound (object sender, Re Peateritemeventargs e) {try {if (E.item.itemtype = = ListItemType.Item | | e.item.itemtype = = ListItemType.AlternatingItem {GridView GV = E.item.findcontrol ("Gv_inrep") as gridview;//finds the Repeater object in the inner layer Leader ROWV = (Leader) e.item.dataitem;//find The category repeater the associated data item String typeid = Rowv. LoginName; Gets the id setsorting () of the populated subclass; Gv. DataSource = Pointdatasource (typeid); Gv. DataBind (); } catch (Exception ex) { syslog syslog = new Syslog (); syslog. ListName = Constdata.listname_pcitc_ls_schedule; Syslog. Ltype = "Repeater Item binding event exception"; Syslog. Workflowname = "Leadership Schedule management System"; Syslog. Location = "Repeater bound data: otherschedule.aspx"; Syslog. Message = "Page Information Loading exception:" + ex. message; Syslog. DataSource = 0; Logprovider. AddauditrecordtOsource (syslog); } } |