这是我的 ASP:
<asp:GridView ID="GridView1" runat="server" AllowSorting="True" AutoGenerateEditButton="true"
DataSourceID="AccessDataSource1"
AutoGenerateColumns="False" DataKeyNames="ID"
RowStyle-CssClass="editPhotoGridFormat"
AlternatingRowStyle-CssClass="editPhotoGridFormat"
AlternatingRowStyle-BackColor="Gray"
RowStyle-Height="400px"
RowStyle-VerticalAlign="Top">
<RowStyle Height="400px" />
<Columns>
<asp:CommandField ShowSelectButton="True" />
<asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False"
ReadOnly="True" SortExpression="ID" />
<asp:BoundField DataField="BlogTitle" HeaderText="BlogTitle"
SortExpression="BlogTitle" />
<asp:ImageField DataImageUrlField="Image" HeaderText="Image"
DataImageUrlFormatString="~/PlaceImages/{0}" ControlStyle-CssClass="editPhotoGridFormat"
AlternateText="Something went wrong"
NullDisplayText="No picture on file" />
<asp:BoundField DataField="PicText" HeaderText="PicText" />
<asp:BoundField DataField="TravelDate" HeaderText="TravelDate" SortExpression="TravelDate" />
<asp:BoundField DataField="BeginText" HeaderText="BeginText" ItemStyle-Height="10px" />
<asp:BoundField DataField="Caption" HeaderText="Caption" />
<asp:BoundField DataField="City" HeaderText="City" />
<asp:BoundField DataField="Country" HeaderText="Country"
SortExpression="Country" />
<asp:BoundField DataField="EndText" HeaderText="EndText" />
</Columns>
</asp:GridView>
这是我的CSS:
.editPhotoGridFormat
{
width: 220px;
height: 180px;
}
似乎无论我在哪里设置高度,它都不想改变我的行的高度。您可以看到我在代码中的很多地方都设置了高度,并且我已经尝试单独使用每个地方。有什么想法吗?这里关于gridview 行高的所有帖子似乎都是针对Android 的,哈哈。