PDA

View Full Version : سوال: نمایش جدول اکسس



soheila2012
دوشنبه 30 اردیبهشت 1392, 19:46 عصر
از Gridview استفاده کردم ولی بد نشون میده!! نمیتونم رو colume دسترسی داشته باشم فقط میتونم عنوانش رو تغیر بدم اندازه برام مهمه.

اینجا تنظیماتی داره؟
مثلا فیلدی ردیف از جدول رو میخوام موقع نمایش کوچکتر فیلد متن باشه! امیدوارم متوجه شده باشین!

meisam12
دوشنبه 30 اردیبهشت 1392, 22:53 عصر
با سلام
شما می توانید از css مثل زیر استفاده کنید تا گریدتان شکل دلخواه تان را بدست آورد.

<asp:GridView ID="gvCustomres" runat="server"
DataSourceID="customresDataSource"
AutoGenerateColumns="False"
GridLines="None"
AllowPaging="true"
CssClass="mGrid"
PagerStyle-CssClass="pgr"
AlternatingRowStyle-CssClass="alt">
<Columns>
<asp:BoundField DataField="CompanyName" HeaderText="Company Name" />
<asp:BoundField DataField="ContactName" HeaderText="Contact Name" />
<asp:BoundField DataField="ContactTitle" HeaderText="Contact Title" />
<asp:BoundField DataField="Address" HeaderText="Address" />
<asp:BoundField DataField="City" HeaderText="City" />
<asp:BoundField DataField="Country" HeaderText="Country" />
</Columns>
</asp:GridView>


.mGrid {

width: 100%;

background-color: #fff;

margin: 5px 0 10px 0;

border: solid 1px #525252;

border-collapse:collapse;

}

.mGrid td {

padding: 2px;

border: solid 1px #c1c1c1;

color: #717171;

}

.mGrid th {

padding: 4px 2px;

color: #fff;

background: #424242 url(grd_head.png) repeat-x top;

border-left: solid 1px #525252;

font-size: 0.9em;

}

.mGrid .alt { background: #fcfcfc url(grd_alt.png) repeat-x top; }

.mGrid .pgr { background: #424242 url(grd_pgr.png) repeat-x top; }

.mGrid .pgr table { margin: 5px 0; }

.mGrid .pgr td {

border-width: 0;

padding: 0 6px;

border-left: solid 1px #666;

font-weight: bold;

color: #fff;

line-height: 12px;

}

.mGrid .pgr a { color: #666; text-decoration: none; }

.mGrid .pgr a:hover { color: #000; text-decoration: none; }