2013-04-05 129 views
0

我正在使用RadGrid,並在此網格中有與ImageUrl的按鈕。在IE8我有一些問題,正確地顯示它們(水平),而不是喜歡這個在網格中顯示圖像

enter image description here

所以我想我應該改變按鈕的寬度,但隨後事情發生,我真的不知道爲什麼發生這種情況。 ..我只是改變從20像素的寬度至30像素

enter image description here

有人可以幫我如何改變這一點,這是正常的像其他瀏覽器(水平兩個圖片...

我的代碼

<telerik:RadGrid ID="rgGrid" runat="server" DataSourceID="SqlDataSource1" 
      AllowSorting="True" AllowPaging="True" PageSize="20" 
      AllowFilteringByColumn="True" ShowStatusBar="True" Width="100%" 
      CellSpacing="0" GridLines="None" OnItemCommand="rgGrid_ItemCommand"> 
    <MasterTableView AutoGenerateColumns="False" DataKeyNames="OrganisationId"> 
     <NoRecordsTemplate> 
      Can't find Organisations to display 
     </NoRecordsTemplate> 
     <Columns> 
      <telerik:GridBoundColumn DataField="OrganisationId" DataType="System.Int32" 
       FilterControlAltText="Filter OrganisationId column" 
       HeaderText="OrganisationId" ReadOnly="True" SortExpression="OrganisationId" 
       UniqueName="OrganisationId" Visible="false"> 
      </telerik:GridBoundColumn> 
      <telerik:GridBoundColumn DataField="OrganisationName" FilterControlAltText="Filter 
        OrganisationName column" HeaderText="Name" ItemStyle-Width="60px" 
        SortExpression="OrganisationName" UniqueName="OrganisationName"> 
       <ItemStyle Width="60px" /> 
      </telerik:GridBoundColumn> 
      <telerik:GridBoundColumn DataField="CountryName" FilterControlAltText="Filter 
        CountryName column" HeaderText="Country" ItemStyle-Width="60px" 
        SortExpression="CountryName" UniqueName="CountryName"> 
       <ItemStyle Width="60px" /> 
      </telerik:GridBoundColumn> 
      <telerik:GridTemplateColumn UniqueName="DeleteColumn" ItemStyle-Width="20px" 
        AllowFiltering="false"ItemStyle-HorizontalAlign="Right" > 
       <ItemTemplate> 
       <telerik:RadButton ID="btnEdit" CommandName="Edit" runat="server" 
         Width="30px" ToolTip="View Details" Height="20px" 
         CommandArgument='<%# DataBinder.Eval(Container.DataItem, "OrganisationId")%>'> 
         <Image ImageUrl="~/Resources/Images/Grid/edit-app.png" 
          IsBackgroundImage="true" /> 
       </telerik:RadButton> 
       <telerik:RadButton ID="btnDelete" CommandName="Delete" runat="server" 
         Width="20px" ToolTip="Delete Vacation" 
         Height="20px" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "OrganisationId")%>'> 
       <Image ImageUrl="~/Resources/Images/Grid/delete-app.png" 
         IsBackgroundImage="true" /> 
       </telerik:RadButton> 
      </ItemTemplate> 
     </telerik:GridTemplateColumn> 
    </Columns> 
    </MasterTableView> 
    </telerik:RadGrid> 

感謝您的幫助ANS快回答!

回答

1

給一類圖像第一:

<Image ImageUrl="~/Resources/Images/Grid/edit-app.png" 
IsBackgroundImage="true" CssClass="someclass" /> 

新增CSS

.someclass { 
    background-repeat: no-repeat; 
} 

,因爲它呈現爲背景圖像。