国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費電子書等14項超值服

開通VIP
gridview datalist行顏色漸變實例代碼
行之間顏色間隔:

  gridview:<AlternatingRowStyle ForeColor="#ffffff" BackColor="#ECECEC" />

  datalist/datagrid:<AlternatingItemStyle ForeColor="#ffffff" BackColor="#ECECEC" />

  鼠標滑過顏色變化:

  gridview:

  代碼

  1 protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)

  2     {

  3         if (e.Row.RowType == DataControlRowType.DataRow)

  4         {

  5             e.Row.Attributes.Add("onmouseover", "currentColor=this.style.backgroundColor;this.style.backgroundColor='#E8D098'");

  6             e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=currentColor");

  //單擊行改變行背景顏色

  e.Row.Attributes.Add("onclick","this.style.backgroundColor='顏色'; this.style.color='buttontext';this.style.cursor='default';");

  7         }

  8     }

  datagird:

  代碼

  1 protected void dgValueInfo_ItemDataBound(object sender, DataGridItemEventArgs e)

  2     {

  3         if (e.Item.ItemIndex != -1)

  4         {

  5             e.Item.Cells[0].Text = (e.Item.ItemIndex + 1).ToString();

  6             ListItemType itemType = e.Item.ItemType;

  7              if (itemType == ListItemType.Item)

  8             {

  9                 e.Item.Attributes.Add("onmouseover", "e=this.style.backgroundColor; this.style.backgroundColor='#FBF9F9'");

  10                 e.Item.Attributes.Add("onmouseout", "this.style.backgroundColor=e");

  11             }

  12          }

  13    }

  datalist:

  這個用類似上面的方式好像沒有效果,所以可以考慮在頁面去實現(xiàn):

  代碼

  1   <asp:DataList ID="dlMain" runat="server" >

  2      <AlternatingItemStyle ForeColor="#ffffff" BackColor="#ECECEC" />

  3       <HeaderTemplate>

  4         <asp:Table ID="tabHeader" runat="server" CssClass="gridviewHead">

  5           <asp:TableRow CssClass="Header">

  6               <asp:TableCell CssClass="gridviewHead">序號 </asp:TableCell>

  7           </asp:TableRow>

  8         </asp:Table>

  9       </HeaderTemplate>

  10        <ItemTemplate>

  11           <asp:Table ID="tabItem" runat="server" CssClass="GridTableTDCenter">

  12             <asp:TableRow onmouseover="currentColor=this.style.backgroundColor;this.style.backgroundColor='#FBF9F9'"     onmouseout="this.style.backgroundColor=currentColor>

  13              <asp:TableCell CssClass="GridTableTDCenter"><#Container.ItemIndex+1%></asp:TableCell>

  14            </asp:TableRow>

  15          </asp:Table>

  16     </ItemTemplate>

  17  </asp:DataList>

  或者有table,則在tr中實現(xiàn)....
 

本站僅提供存儲服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊舉報。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
ASP.NET 2.0服務(wù)器控件開發(fā)之控件樣式
Asp.Net中GridView加入鼠標滑過的高亮效果和單擊行顏色改變
Gridview光棒效果 鼠標滑過
Table控件使用示例
DataGrid/DataList的使用
GridView點擊行按鈕的時候固定滾動條的實現(xiàn)方法
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長圖 關(guān)注 下載文章
綁定賬號成功
后續(xù)可登錄賬號暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點擊這里聯(lián)系客服!

聯(lián)系客服