safari浏览器下开发,现页面上有一个gridview控件:
<asp:GridView ID="gvVitalData" runat="server" AutoGenerateColumns="False" ShowHeader="False" BorderStyle="None" BorderWidth="0px" CellPadding="0">
<AlternatingRowStyle BackColor="White" />
<Columns>
<asp:BoundField DataField="A">
<ItemStyle Width="103px" />
</asp:BoundField>
<asp:BoundField DataField="B">
<ItemStyle Width="103px" />
</asp:BoundField>
<asp:BoundField DataField="C">
<ItemStyle Width="103px" />
</asp:BoundField>
<asp:BoundField DataField="D">
<ItemStyle Width="103px" />
</asp:BoundField>
<asp:BoundField DataField="E">
<ItemStyle Width="103px" />
</asp:BoundField>
</Columns>
<RowStyle Height="27px"></RowStyle>
</asp:GridView>
显示效果为前两行数据居中显示,其他数据居右显示。此效果如何实现,望各位大侠指教 ...
<asp:GridView ID="gvVitalData" runat="server" AutoGenerateColumns="False" ShowHeader="False" BorderStyle="None" BorderWidth="0px" CellPadding="0">
<AlternatingRowStyle BackColor="White" />
<Columns>
<asp:BoundField DataField="A">
<ItemStyle Width="103px" />
</asp:BoundField>
<asp:BoundField DataField="B">
<ItemStyle Width="103px" />
</asp:BoundField>
<asp:BoundField DataField="C">
<ItemStyle Width="103px" />
</asp:BoundField>
<asp:BoundField DataField="D">
<ItemStyle Width="103px" />
</asp:BoundField>
<asp:BoundField DataField="E">
<ItemStyle Width="103px" />
</asp:BoundField>
</Columns>
<RowStyle Height="27px"></RowStyle>
</asp:GridView>
显示效果为前两行数据居中显示,其他数据居右显示。此效果如何实现,望各位大侠指教 ...
解决方案 »
- Web.config注册用户空间引用出错
- |M| 大家看一下这样的 用户登录 需求要怎么来做合适 谢谢
- 多人同时提交表单,写数据库,会不会出错,
- 编码的奇怪问题
- 各位大哥,大姐帮我看看,datagrid删除按钮事件为什么不弹出提示框
- visual studio.net监测到指定的web服务器运行的不是asp.net1.1版,我该怎么办??
- 如何实现URL重写
- Microsoft JScript 运行时错误: 没有权限
- 救命阿!!!请问有什么工具能快速删掉asp程序或vb程序或存储过程的注释
- 调用对方接口;出现连接的主机没有反应,连接尝试失败错误 求解,谢谢
- 客户端发现响应内容类型为“text/html; charset=utf-8”,但应为“text/xml”。
- 在线等—jquery实现鼠标指在图片上面,弹出一个详细信息,如图:
GridView1.Rows[1].Style = "text-align:center";
<Chsoft:SmartGridView ID="gv基础_城市" runat="server" Width="100%" IsShowSingleSelectColumn="true"
BorderStyle="None" AllowPaging="true" IsShowFooterToolbar="True" IsShowHeaderToolbar="true"
IsSinglePageDataMode="False" IsDoubleClickSelectOneLine="true" PageSize="15"
OnRowDataBound="gv基础_城市_RowDataBound" IsTriggerSelect="false" IsHideCheckBoxColumn="false"
SingleSelectColumnValueFiled="城市ID" IsAutoSetHorizontalAlign="false"
OnRowCommand="gv基础_城市_RowCommand">
<Columns>
<asp:TemplateField HeaderText="城市名称">
<ItemStyle HorizontalAlign="Left" Width="150px" />
<ItemTemplate>
<asp:LinkButton ID="btn城市名称" runat="server" Text='<%#Eval("城市名称")%>' CommandArgument='<%#Eval("城市ID")%>'
CommandName="ViewData"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="所属省份">
<ItemStyle HorizontalAlign="Left" Width="150" />
<ItemTemplate>
<%#Eval("省名称")%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="排序号">
<ItemStyle HorizontalAlign="Right" Width="30"/>
<ItemTemplate>
<%#Eval("排序号")%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="状态">
<ItemStyle HorizontalAlign="Center" Width="60px" />
<ItemTemplate>
<asp:Label ID="lbl状态" runat="server" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<HeaderStyle BackColor="White" Font-Bold="True" Font-Size="9pt" VerticalAlign="Middle"
Wrap="True" />
<PagerStyle VerticalAlign="Top" />
<AlternatingRowStyle VerticalAlign="Top" />
</Chsoft:SmartGridView>
GridView1.Rows[0].Style = "text-align:center";
GridView1.Rows[1].Style = "text-align:center"; protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
GridView1.Rows[0].Style = "text-align:center";
GridView1.Rows[1].Style = "text-align:center";
//颜色设置
}