我正在尝试在Android原生浏览器中水平滚动gridview。我已将gridview放在面板标签中。但水平滚动不适用于Android手机。它在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>
答案 0 :(得分:0)
尝试使用CSS Div: .grdScroll { moverflow:滚动; } 然后在你的.aspx中: 你的gridview控件......