我对gridview设计有疑问,谁能帮助我。我创建了一个gridview,但是当我给那个网格单元格提供任何文本时,我的网格设计正在改变。我的问题是,即使我们将文本输入到一个单元格或没有:单元格,如何为 gridview 提供固定高度。这是我的代码。先感谢您。
<asp:GridView ID="GrvSchoolName1" runat="server" AllowPaging="True" PageSize="4" Height="30px" BackColor="White"
BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" CellPadding="3"
GridLines="Vertical" CssClass="grvclass"
AutoGenerateColumns="False"
ForeColor="Black" onpageindexchanging="GrvSchoolName1_PageIndexChanging">
<PagerSettings Mode="NumericFirstLast" PageButtonCount="4" FirstPageText="First" LastPageText="Last"/>
<AlternatingRowStyle BackColor="#CCCCCC" />
<Columns>
<asp:TemplateField HeaderText="Emergency Alert" HeaderStyle-Height="30px">
<ItemTemplate>
<div style="overflow:auto; height:60px;">
<asp:Label ID="Label1" runat="server" Text='<% #Eval("AlertMessage") %>' ></asp:Label>
</div>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<FooterStyle BackColor="#CCCCCC" />
<HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
<SortedAscendingCellStyle BackColor="#F1F1F1" />
<SortedAscendingHeaderStyle BackColor="#808080" />
<SortedDescendingCellStyle BackColor="#CAC9C9" />
<SortedDescendingHeaderStyle BackColor="#383838" />
</asp:GridView>
</div>