我有一個GridView,並在第一行我想要的行左20px填充。我試圖用CSSClass做,但不起作用。CssClass的ItemStyle不起作用
<div class="rounded-corners"; style=" margin-left:50px; margin-right:50px; ">
<asp:GridView id="MyGridView"
DataSourceID="MyDataSource1"
AutoGenerateColumns="False"
GridLines="None"
AllowSorting="True"
AllowPaging="True"
CssClass="mGrid"
PagerStyle-CssClass="pgr"
AlternatingRowStyle-CssClass="alt"
Runat="Server" PageSize="35" HorizontalAlign="Justify"
onselectedindexchanged="MyGridView_SelectedIndexChanged"
onrowdatabound="MyGridView_RowDataBound">
<PagerSettings FirstPageText="Début" LastPageText="Fin" NextPageText="Suivant"
PageButtonCount="15" PreviousPageText="Précedent" />
<columns>
<asp:boundfield datafield="FICHIER"
readonly="true"
headertext="Fichier">
<ItemStyle CssClass="CellFile" />
</asp:boundfield>
.....
.....
.....
用的CssClass如下:
<style type="text/css">
.CellFile
{
padding-left:100px;
margin-left:100px;
color:Lime;
background-color:Red;
}
</style>
那麼,什麼可能是錯在這裏?
定義CSS類像.rounded來訪者的模板列.mGrid .CellFile – 2013-04-26 10:53:47
我甚至刪除了所有定義的類除.CellFile,仍然不起作用。 – 2013-04-26 11:00:45