0

我正在尝试在 android 本机浏览器中水平滚动 gridview。我已将我的 gridview 放在面板标签中。但水平滚动不适用于安卓手机。它在 iphone 中运行良好。有什么建议么。代码如下所示。

            <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                AllowSorting="True" AutoGenerateColumns="False" BackColor="White" 
                BorderColor="#999999" BorderStyle="None" BorderWidth="1px" CellPadding="3" 
                DataSourceID="test" GridLines="Vertical" 
                ShowFooter="True" onrowdatabound="GridView1_RowDataBound" PageSize="20" Width = "100%" style =" display:table; width:100%; 
        word-wrap: break-word; " scrollbars="horizontal">
                <AlternatingRowStyle BackColor="#DCDCDC" />
                <Columns>
                    <asp:BoundField DataField="location_name" HeaderText="Location Name" ><ItemStyle /></asp:BoundField>
                    <asp:BoundField DataField="room_type_description" HeaderText="Room Type" ><ItemStyle /></asp:BoundField>
                    <asp:BoundField DataField="arrival_date" HeaderText="Arrival Date" 
                        DataFormatString="{0:d}" ><ItemStyle /></asp:BoundField>
                    <asp:BoundField DataField="departure_date" HeaderText="Departure Date" 
                       DataFormatString="{0:d}" ><ItemStyle /></asp:BoundField>
                    <asp:BoundField DataField="nights" HeaderText="# of Nights Stayed"  ><ItemStyle HorizontalAlign="Right" /></asp:BoundField>
                    <asp:BoundField DataField="reservation_number" HeaderText="Reservation Number" ><ItemStyle  /></asp:BoundField>
                    <asp:TemplateField HeaderText="Points">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("points") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label1" runat="server" Text='<%# Bind("points") %>'></asp:Label>
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Right"  />
                        <FooterTemplate>
                            <asp:Label ID="subTotalValueLabel" runat="server" Text=""></asp:Label><br />
                            <asp:Label ID="grandTotalValueLabel" runat="server" Text=""></asp:Label>
                        </FooterTemplate>
                    </asp:TemplateField>
                </Columns>
                <FooterStyle BackColor="#CCCCCC" ForeColor="Black" Font-Bold="True" 
                    HorizontalAlign="Right"/>
                <HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
                <RowStyle BackColor="#EEEEEE" ForeColor="Black" />
                <SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
                <SortedAscendingCellStyle BackColor="#F1F1F1" />
                <SortedAscendingHeaderStyle BackColor="#0000A9" />
                <SortedDescendingCellStyle BackColor="#CAC9C9" />
                <SortedDescendingHeaderStyle BackColor="#000065" />

                <EmptyDataTemplate>
                    <table cellspacing="0" cellpadding="3" rules="cols" border="1" style="background-color:White;border-color:#999999;border-width:1px;border-style:None;border-collapse:collapse;">
                        <tr style="color:White;background-color:#000084;font-weight:bold;">
                            <th scope="col">Location Name</th><th scope="col">Room Type</th><th scope="col">Arrival Date</th><th scope="col">Departure Date</th><th scope="col"># of Nights Stayed</th><th scope="col">Reservation Number</th><th scope="col">Points</th>
                        </tr><tr style="color:Black;background-color:#EEEEEE;">
                            <td colspan="7" align="center">No stay history data found.</td>

                    </table>                        
                </EmptyDataTemplate>

                <SortedAscendingCellStyle BackColor="#F1F1F1" />
                <SortedAscendingHeaderStyle BackColor="#0000A9" />
                <SortedDescendingCellStyle BackColor="#CAC9C9" />
                <SortedDescendingHeaderStyle BackColor="#000065" />

            </asp:GridView>
            <asp:Label ID="TotalPointsAvailableLabel" runat="server" Text=""></asp:Label>
        </asp:Panel>
4

1 回答 1

0

尝试使用 CSS Div,例如: .grdScroll { moverflow:scroll ; 然后在您的 .aspx 中:您的 gridview 控件...

于 2013-11-14T18:01:32.427 回答