2014-04-07 2 views
1

나는 ButtonField 스타일을 내 표 스타일과 일치하도록 변경하려고합니다. 여기 내 GridView입니다 :바둑판 모양의 buttonfield의 배경색과 배경색 변경

<asp:GridView ID="GridView1" runat="server" Width="936px" AllowPaging="True" AutoGenerateColumns="False" 
    CellPadding="4" DataSourceID="SqlDataSource1" OnRowCommand="GridView1_RowCommand" 
    ForeColor="#333333" GridLines="None" Style="text-align: center"> 
    <AlternatingRowStyle BackColor="White" /> 
    <Columns> 
     <asp:BoundField DataField="TaskId" HeaderText="TaskId" InsertVisible="False" ReadOnly="True" 
      SortExpression="TaskId" /> 
     <asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" /> 
     <asp:BoundField DataField="Body" HeaderText="Body" SortExpression="Body" Visible="false" /> 
     <asp:BoundField DataField="Reward" HeaderText="Reward(Rs)" SortExpression="Reward" /> 
     <asp:BoundField DataField="TimeAllotted" HeaderText="Time(Min)" SortExpression="TimeAllotted" /> 
     <asp:BoundField DataField="PosterName" HeaderText="Uploader" SortExpression="PosterName" /> 
     <asp:ButtonField ButtonType="Button" CommandName="Select" Text="Perform Task" /> 
    </Columns> 
    <EditRowStyle BackColor="#2461BF" /> 
    <FooterStyle BackColor="#507CD1" ForeColor="White" Font-Bold="True" /> 
    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" /> 
    <PagerStyle ForeColor="White" HorizontalAlign="Center" BackColor="#2461BF" /> 
    <RowStyle BackColor="#EFF3FB" /> 
    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" /> 
    <SortedAscendingCellStyle BackColor="#F5F7FB" /> 
    <SortedAscendingHeaderStyle BackColor="#6D95E1" /> 
    <SortedDescendingCellStyle BackColor="#E9EBEF" /> 
    <SortedDescendingHeaderStyle BackColor="#4870BE" /> 
</asp:GridView> 

나는 BackColorForeColor 속성을 사용하려했지만 그들은 ButtonField에 대한 유효한 속성 수 없습니다. 아래처럼 ControlStyle-BackColor을 사용

+0

ControlStyle-의 BackColor = "블루". 나는 당신이 가지고 싶은 어떤 색깔을 의미합니다. –

답변

0

시도 : 버튼을

<asp:ButtonField ButtonType="Button" CommandName="Select" Text="Perform Task" ControlStyle-BackColor="LightBlue" />