DevExpress.XtraTreeList 小结
搞了半天才绑定好,没有弄清楚父子之间的关系
<dx:ASPxTreeList ID="ASPxTreeList1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" KeyFieldName="child_id" ParentFieldName="parent_id"> <Columns> <dx:TreeListTextColumn FieldName="Product_name" VisibleIndex="0"> </dx:TreeListTextColumn> <dx:TreeListTextColumn FieldName="Product_sum" VisibleIndex="1"> </dx:TreeListTextColumn> <dx:TreeListTextColumn FieldName="support_id" VisibleIndex="2"> </dx:TreeListTextColumn> <dx:TreeListTextColumn FieldName="child_id" VisibleIndex="3"> </dx:TreeListTextColumn> <dx:TreeListTextColumn FieldName="parent_id" VisibleIndex="4"> </dx:TreeListTextColumn> </Columns> <SettingsSelection AllowSelectAll="True" Enabled="True" Recursive="True" /> </dx:ASPxTreeList> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:Test_CumtomConnectionString %>"SelectCommand="SELECT * FROM [db_product_information]"
额,我怕忘了,就先传点,主要是关系要对好
这边
KeyFieldName="child_id"
ParentFieldName="parent_id"
年轻过得闲,以后被人嫌...
年轻累不死....