【问题标题】:DEVExpress's ASPXTreeList always returning same clientlayoutDEVExpress 的 ASPXTreeList 总是返回相同的客户端布局
【发布时间】:2017-08-03 06:32:33
【问题描述】:

我正在使用 DevExpress 的 aspxtreelist,但无法保存客户端布局:

AspxTreeList.SaveClientLayout();

我让 gridview 和 pivotgrid 的 SaveClientLayout 工作,但每当我为 treelist 调用 SaveClientLayout 时,它都会返回相同的内容。

保存布局的代码:(在按钮单击中尝试)

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

布局字符串:

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

【问题讨论】:

    标签: c# asp.net devexpress treelist


    【解决方案1】:

    原来 treelist 需要启用 cookie。启用 cookie 有效

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-01-14
      • 2023-03-25
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多