Datagrid
Disadvantages relative to the previous use of relation:
1. Cannot limit the number of records returned; 2. State time inconvenient, not even the state set; 3. The procedure is simple, but not easy to understand. 4. Possible nesting of more than three layers is not easy to implement.
The nesting scheme given this time, the use of the ItemDataBound event nesting, easy to implement, it is easier to understand. and solved the above four problems.
Here's the main code:
<asp:datalist id= "Dlist_class" datakeyfield= "NavigatorId"
Backcolor= "#ffffff" borderwidth= "0px" cellpadding= "1"
Showfooter= "false" Showheader= "false" runat= "Server"
cellspacing= "horizontalalign=" "Justify" repeatcolumns= "2"
repeatdirection= "Horizontal" repeatlayout= "Table" >
<itemstyle verticalalign=top></itemstyle>
<itemtemplate>
<b><%# DataBinder.Eval (Container.DataItem, "NavigatorId")%> @
<%# DataBinder.Eval (Container.DataItem, "nodecaption")%></b>
<asp:datagrid Id=dg_subclass width=315px Runat=server
Autogeneratecolumns= "false"
Showheader= "false" Showfooter= "false" pagesize= "ten" allowpaging= "true"
Pagerstyle-visible= "false" borderwidth= "1" backcolor= "#ffffff" bordercolor= "#ffffff"
cellpadding= "0" cellspacing= "0" gridlines=horizontal
onitemdatabound= ' Dg_subclass_itemdatabound ' >
<itemstyle height= "14px" backcolor= "#e3f1ff" cssclass= "Gridhover" ></ItemStyle>
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.