DEVExpress的ASPXTreeList总是返回相同的clientlayout

时间:2017-08-03 06:32:34

标签: c# asp.net devexpress treelist

我正在使用DevExpress的aspxtreelist,但在使用以下方法保存clientlayout时遇到问题:

  

AspxTreeList.SaveClientLayout();

我得到了gridview和pivotgrid的SaveClientLayout,但每当我调用SaveClientLayout for treelist时,它都会返回相同的内容。

保存布局的代码:(按下按钮尝试)

byte[] byte123 = tree.SaveClientLayout();
string layoutstring = Convert.ToBase64String(tree.SaveClientLayout());

Layoutstring:

  

AgAHAAcABwAG // // 8G = 8G8P8CAVo

我的行为代码:

                    <dx:ASPxTreeList ID="ASPxTreeList1" runat="server" AutoGenerateColumns="False" ClientInstanceName="treeTo" DataSourceID="SqlDataSource" KeyFieldName="ID" ParentFieldName="PID" OnCustomCallback="ASPxTreeList1_CustomCallback" EnableTheming="True" Theme="Metropolis" OnClientLayout="ASPxTreeList1_ClientLayout">
                        <Columns>
                            <dx:TreeListTextColumn FieldName="ParentID" ShowInCustomizationForm="True" VisibleIndex="2">
                            </dx:TreeListTextColumn>
                            <dx:TreeListTextColumn FieldName="Text" ShowInCustomizationForm="True" VisibleIndex="3">
                            </dx:TreeListTextColumn>
                            <dx:TreeListTextColumn FieldName="NavigateURL" ShowInCustomizationForm="True" VisibleIndex="4">
                            </dx:TreeListTextColumn>
                            <dx:TreeListCommandColumn VisibleIndex="1">
                                <EditButton Visible="True">
                                </EditButton>
                                <NewButton Visible="True">
                                </NewButton>
                                <DeleteButton Visible="True">
                                </DeleteButton>
                            </dx:TreeListCommandColumn>
                        </Columns>
                        <Styles>
                            <Header CssClass="droppableRight"></Header>
                            <Node CssClass="droppableRight"></Node>
                            <AlternatingNode Enabled="True" CssClass="droppableRight">
                            </AlternatingNode>
                        </Styles>
                        <SettingsBehavior AutoExpandAllNodes="True" AllowFocusedNode="True" />
                        <SettingsPager AlwaysShowPager="True" Mode="ShowPager" PageSize="25">
                            <AllButton Visible="True">
                            </AllButton>
                        </SettingsPager>
                        <SettingsEditing AllowNodeDragDrop="True" />
                    </dx:ASPxTreeList>

为什么SaveClientLayout总是返回相同的布局字符串?它适用于gridview和pivotgrid

1 个答案:

答案 0 :(得分:0)

结果显示treelist需要启用Cookie。启用cookie