【问题标题】:Telerik RadGrid design corruptionTelerik RadGrid 设计损坏
【发布时间】:2014-09-02 03:47:50
【问题描述】:

我在 aspx 文件中有一个 RadGrid,当我绑定数据时,它看起来像下面而不是基于列的结构。

构建项目结果:

编辑 Sil StackOverFlow 示例亚历克斯弗格森爵士 - 1 编辑删除 StackOverFlow 示例亚历克斯弗格森爵士 - 2 编辑删除 StackOverFlow 示例亚历克斯弗格森爵士 - 3 编辑删除 StackOverFlow 示例亚历克斯弗格森爵士 - 4 编辑删除 StackOverFlow 示例亚历克斯弗格森爵士 - 5 编辑删除StackOverFlow 示例 Alex Ferguson 爵士 - 6 编辑删除 StackOverFlow 示例 Alex Ferguson 爵士 - 7 编辑删除 StackOverFlow 示例 Alex Ferguson 爵士 - 8 编辑删除 StackOverFlow 示例 Alex Ferguson 爵士 - 9 编辑删除

代码

<telerik:RadGrid ID="radUsers" ShowStatusBar="true" AllowPaging="True" HeaderStyle-Height="20px"
CommandItemStyle-Height="20px" Culture="en-En" runat="server" AllowSorting="True"
GridLines="None" Width="100%" PageSize="40" CellSpacing="0" Skin="Hay" OnExcelMLExportRowCreated="radUsers_ExcelMLExportRowCreated"
OnExcelMLExportStylesCreated="radUsers_ExcelMLExportStylesCreated" OnItemDataBound="radUsers_ItemDataBound"
OnNeedDataSource="radUsers_NeedDataSource"
OnPageIndexChanged="radUsers_PageIndexChanged" MasterTableView-SortExpressions="true">
    <ExportSettings IgnorePaging="true" HideStructureColumns="true" ExportOnlyData="true"
    FileName="Users" OpenInNewWindow="true" Pdf-AllowPrinting="True">
        <Excel Format="ExcelML" />
    </ExportSettings>
    <ClientSettings AllowGroupExpandCollapse="True" ReorderColumnsOnClient="True" AllowDragToGroup="True" AllowColumnsReorder="True">
        <Resizing AllowRowResize="false" EnableRealTimeResize="True" ResizeGridOnColumnResize="True"
        AllowColumnResize="true"></Resizing>
        <Scrolling AllowScroll="False" UseStaticHeaders="True" />
        <Selecting AllowRowSelect="True" />
    </ClientSettings>
    <MasterTableView Width="80%" DataKeyNames="ID" ClientDataKeyNames="ID" AutoGenerateColumns="False"
    CommandItemDisplay="Top" GroupLoadMode="Client">
        <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" Groupable="true">
        </RowIndicatorColumn>
        <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" Groupable="true">
        </ExpandCollapseColumn>

        <Columns>
            <telerik:GridBoundColumn DataField="ACode" FilterControlAltText="Filter ACode column"
                HeaderText="Av. Code" SortExpression="ACode" UniqueName="ACode"
                ItemStyle-Width="80px" HeaderStyle-Width="80px">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="UserType" FilterControlAltText="Filter UserType column"
                HeaderText="User Type" SortExpression="UserType" UniqueName="UserType"
                ItemStyle-Width="140px" HeaderStyle-Width="140px">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Company" FilterControlAltText="Filter Company column"
                HeaderText="Company" SortExpression="Company" UniqueName="Company"
                ItemStyle-Width="210px" HeaderStyle-Width="210px">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="UserName" FilterControlAltText="Filter UserName column"
                HeaderText="User Name" SortExpression="UserName" UniqueName="UserName"
                ItemStyle-Width="140px" HeaderStyle-Width="140px">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="NameSurname" FilterControlAltText="Filter NameSurname column"
                HeaderText="Name Surname" SortExpression="NameSurname" UniqueName="NameSurname"
                ItemStyle-Width="140px" HeaderStyle-Width="140px">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Status" FilterControlAltText="Filter Durum column" HeaderText="Status" SortExpression="Status" UniqueName="Status" ItemStyle-Width="110px" HeaderStyle-Width="110px">
            </telerik:GridBoundColumn>
            <telerik:GridTemplateColumn ItemStyle-Width="70px" HeaderStyle-Width="70px" UniqueName="Edit" HeaderText="">
                <ItemTemplate>
                    <asp:Literal ID="ltrEdit" runat="server"></asp:Literal>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn ItemStyle-Width="40px" HeaderStyle-Width="40px" UniqueName="Delete" HeaderText="" Visible="true">
                <ItemTemplate>
                    <asp:Literal ID="ltrDelete" runat="server"></asp:Literal>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
        </Columns>
        <SortExpressions>
            <telerik:GridSortExpression FieldName="NameSurname" SortOrder="None" />
        </SortExpressions>
        <EditFormSettings>
            <EditColumn FilterControlAltText="Filter EditCommandColumn column">
            </EditColumn>
        </EditFormSettings>
        <CommandItemSettings ShowExportToExcelButton="true" ShowAddNewRecordButton="false" />
    </MasterTableView>
    <FilterMenu EnableImageSprites="False">
    </FilterMenu>
    <PagerStyle Mode="NumericPages"></PagerStyle>
</telerik:RadGrid>
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true" Skin="Hay">
    <Windows>
        <telerik:RadWindow ID="UserListDialog" runat="server" Title="User Info" Height="510px"
        Width="650px"  ReloadOnShow="true" ShowContentDuringLoad="false"
        Modal="true" KeepInScreenBounds="true" />
    </Windows>
</telerik:RadWindowManager>

【问题讨论】:

    标签: c# asp.net datagrid telerik radgrid


    【解决方案1】:

    一些 Telerik 用户发现在网格定义中设置 CommandItemdisplay 会导致皮肤无法正确渲染。这会将网格显示为您所看到的文本。请尝试更改此属性的设置。

    还要仔细检查“Hay”皮肤文件的路径是否正确解析为正确的图像和 CSS 文件。

    查看this thread了解更多信息。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-03-14
      • 2011-01-07
      • 1970-01-01
      • 2014-09-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多