我想将gridView的位置从右侧的默认底部更改为顶部

时间:2018-01-14 06:16:14

标签: c# asp.net

我尝试过PagerStyle-Horizo​​ntalAlign ="对" PagerStyle-VerticalAlign ="顶"但它不起作用

这是gridview代码

                                                           

1 个答案:

答案 0 :(得分:0)

在Theme.css中

.GridPosition
    {
        position:fixed;
        right:50px;
        top:50px;   
    }

在default.aspx

<html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
    <link rel="stylesheet" type="text/css" href="Theme.css" />
    </head>
    <body>

    <form id="form1" runat="server">
    <asp:GridView ID="GridViewTrain" runat="server" EnableModelValidation="True" onrowdeleting="GridView_Train_RowDeleting" onselectedindexchanging="GridView_SelectedIndexChanging"class="GridPosition">
        <Columns>
            <asp:CommandField ShowDeleteButton="True" />
            <asp:CommandField SelectText="Edit" ShowSelectButton="True" />
        </Columns>
       </asp:GridView>
    </form> 
    </body>
    </html>