ramin149
سه شنبه 27 مهر 1389, 15:17 عصر
من این کد css رو برای طرحی گرید ویو ام نوشتم
.SGrid { width: 100%; background-color: #fff; margin: 5px 0 10px 0; border: solid 1px #525252; border-collapse:collapse; }
.sGrid td
{
padding: 2px;
border: solid 1px #c1c1c1;
color: #717171;
font-size: 11px;
font-family: tahoma;
}
.sGrid th
{
padding: 4px 2px;
color: #fff;
background: #424242 url(images/red/grid/sgrd_head.png) repeat-x top;
border-left: solid 1px #fc8181;
font-size: 11px;
font-family: tahoma;
}
.sGrid .salt { background: #fcfcfc url(images/red/grid/sgrd_alt.png) repeat-x top; }
.sGrid .sbak { background: #c5c4c4 url(images/red/grid/sgrd_bak.png) repeat-x top; }
.sGrid .spgr {background: #fc9292 url(images/red/grid/sgrd_pgr.png) repeat-x top; }
.sGrid .spgr table { margin: 5px 0; }
.sGrid .spgr td { border-width: 0; padding: 0 6px; border-left: solid 1px #666; font-weight: bold; color: #fff; line-height: 12px; }
.sGrid .spgr a { color: #666; text-decoration: none; }
.sGrid .spgr a:hover { color: #000; text-decoration: none; }
ولی برای تعریفش رو گرید ویو باید 4 بار تعریف کنم که این وقت گیره نمیشه یه کاری گرد که فقط به class css داد و دیگه برای بقیه تعریف نکرد ؟؟؟
کد تعریف
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
CssClass="mGrid" DataKeyNames="id" DataSourceID="SqlDataSource1"
AlternatingRowStyle-CssClass="malt"
RowStyle-CssClass="mbak"
PagerStyle-CssClass="spgr"
EmptyDataText="There are no data records to display." Width="850px"
AllowPaging="True" PageSize="2">
.SGrid { width: 100%; background-color: #fff; margin: 5px 0 10px 0; border: solid 1px #525252; border-collapse:collapse; }
.sGrid td
{
padding: 2px;
border: solid 1px #c1c1c1;
color: #717171;
font-size: 11px;
font-family: tahoma;
}
.sGrid th
{
padding: 4px 2px;
color: #fff;
background: #424242 url(images/red/grid/sgrd_head.png) repeat-x top;
border-left: solid 1px #fc8181;
font-size: 11px;
font-family: tahoma;
}
.sGrid .salt { background: #fcfcfc url(images/red/grid/sgrd_alt.png) repeat-x top; }
.sGrid .sbak { background: #c5c4c4 url(images/red/grid/sgrd_bak.png) repeat-x top; }
.sGrid .spgr {background: #fc9292 url(images/red/grid/sgrd_pgr.png) repeat-x top; }
.sGrid .spgr table { margin: 5px 0; }
.sGrid .spgr td { border-width: 0; padding: 0 6px; border-left: solid 1px #666; font-weight: bold; color: #fff; line-height: 12px; }
.sGrid .spgr a { color: #666; text-decoration: none; }
.sGrid .spgr a:hover { color: #000; text-decoration: none; }
ولی برای تعریفش رو گرید ویو باید 4 بار تعریف کنم که این وقت گیره نمیشه یه کاری گرد که فقط به class css داد و دیگه برای بقیه تعریف نکرد ؟؟؟
کد تعریف
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
CssClass="mGrid" DataKeyNames="id" DataSourceID="SqlDataSource1"
AlternatingRowStyle-CssClass="malt"
RowStyle-CssClass="mbak"
PagerStyle-CssClass="spgr"
EmptyDataText="There are no data records to display." Width="850px"
AllowPaging="True" PageSize="2">