• ASPxGridView自适应高度设置


    页面大小改变,ASPxGridview 高度自动适应,如何操作呢?

    废话不多说,直接上代码。

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
    <%@ Register Assembly="DevExpress.Web.ASPxGridView.v9.3, Version=9.3.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
        Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dx" %>
    <%@ Register Assembly="DevExpress.Web.ASPxEditors.v9.3, Version=9.3.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
        Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dx" %>
    <%@ Register Assembly="DevExpress.Web.v9.3, Version=9.3.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
        Namespace="DevExpress.Web.ASPxGlobalEvents" TagPrefix="dx" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title></title>
        <style type="text/css">
            body, html
            {
                padding: 0;
                margin: 0;
            }
        </style>
        <script type="text/javascript">
            function OnInit(s, e) {
                AdjustSize();
            }
            function OnEndCallback(s, e) {
                AdjustSize();
            }
            function OnControlsInitialized(s, e) {
                ASPxClientUtils.AttachEventToElement(window, "resize", function (evt) {
                    AdjustSize();
                });
            }
            function AdjustSize() {
                var height = Math.max(0, document.documentElement.clientHeight);
                grid.SetHeight(height);
            }
        </script>
    </head>
    <body style="overflow: hidden">
        <form id="form1" runat="server">
        <dx:ASPxGridView runat="server" ID="gridView" ClientInstanceName="grid" AutoGenerateColumns="true"
            Width="100%" DataSourceID="ds" KeyFieldName="OrderID">
            <SettingsPager PageSize="50" />
            <Settings ShowVerticalScrollBar="true" VerticalScrollableHeight="0" />
            <ClientSideEvents Init="OnInit" EndCallback="OnEndCallback" />
        </dx:ASPxGridView>
       
        </form>
    </body>
    </html> 
  • 相关阅读:
    VUE学习笔记--模板渲染
    VUE学习笔记--生命周期 Vue
    VUE学习笔记--实例及选项
    VUE学习笔记--Vue的模板语法
    Vue学习笔记--Vue 简述
    吴裕雄--天生自然--SPRING BOOT--解决:Lifecycle mapping "org.eclipse.m2e.jdt.JarLifecycleMapping" is not available. To enable full functionality, install the lifecycle
    【Vue2.x】Vue UI中无法安装指定版本依赖解决方法
    mysql加锁过程
    java实现交替打印的四种方法
    23th CSP 游记
  • 原文地址:https://www.cnblogs.com/topsyuan/p/11005616.html
Copyright © 2020-2023  润新知