###実現したいこと
・GridViewヘッダ部のセンタリング
###発生している問題・エラーメッセージ
・HeaderStyle HorizontalAlign="Center"が効かない
###該当のソースコード
html
1<asp:GridView ID="GridView1" runat="server" AllowPaging="True" PageSize="25" AutoGenerateColumns="False" BackColor="White" BorderColor="#3366CC" BorderStyle="None" BorderWidth="1px" CellPadding="6" EnableModelValidation="True" Width="950px" > 2 <FooterStyle BackColor="#99CCCC" ForeColor="#003399" /> 3 <HeaderStyle BackColor="#003399" Font-Bold="True" ForeColor="#CCCCFF" /> 4 <PagerStyle HorizontalAlign="center" VerticalAlign="Top" BackColor="#99CCCC" ForeColor="#003399" /> 5 <Columns> 6 <asp:ButtonField ButtonType="Button" Text="ボタン1" CommandName="button1" /> 7 <asp:ButtonField ButtonType="Button" Text="ボタン2" CommandName="button2" /> 8 <asp:BoundField DataField="AAA" HeaderText="AAA" > 9 <ItemStyle HorizontalAlign="Center" /> 10 </asp:BoundField> 11 <asp:BoundField DataField="BBB" HeaderText="BBB" > 12<!-- この部分 --> 13 <HeaderStyle HorizontalAlign="Center" /> 14 </asp:BoundField> 15 <asp:BoundField DataField="CCC" HeaderText="CCC" > 16 <ItemStyle HorizontalAlign="Center" /> 17 </asp:BoundField> 18 <asp:BoundField DataField="DDD" HeaderText="DDD" > 19 <ItemStyle HorizontalAlign="Center" /> 20 </asp:BoundField> 21 <asp:BoundField DataField="EEE" HeaderText="EEE" > 22 <ItemStyle HorizontalAlign="Center" /> 23 </asp:BoundField> 24 <asp:BoundField DataField=FFF" HeaderText="FFF" > 25 <ItemStyle HorizontalAlign="Center" /> 26 </asp:BoundField> 27 <asp:BoundField DataField="GGG" HeaderText="GGG"></asp:BoundField> 28 <asp:BoundField DataField="HHH" HeaderText="HHH" > 29 <ItemStyle HorizontalAlign="Center" /> 30 </asp:BoundField> 31 <asp:BoundField DataField="III" HeaderText="III" > 32 <ItemStyle HorizontalAlign="Center" /> 33 </asp:BoundField> 34 </Columns> 35 <RowStyle BackColor="White" ForeColor="#003399" /> 36 <SelectedRowStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" /> 37 </asp:GridView>
###補足情報(言語/FW/ツール等のバージョンなど)
Webform(.net4.5)
コード側(C#)でdatasetをつくりdatabindしている。
ItemStyleのセンタリングは効いている
マスタページでbootstrap3を読み込んでいる。
ご教示ください。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/10/04 09:46
退会済みユーザー
2016/10/04 09:58
2016/10/04 10:29