zoukankan      html  css  js  c++  java
  • GridView

    1.ASPX

    <asp:GridView ID="gdvDealers" runat="server" AutoGenerateColumns="False"
            CssClass="tableData" Style="margin: 0px;" OnRowDataBound="gdvDealers_RowDataBound" OnSelectedIndexChanged="xxx"

    2.ASPX.cs

    protected void gdvDealers_RowDataBound(object sender, GridViewRowEventArgs ev)

                if (ev.Row.RowType == DataControlRowType.DataRow)
                {
                    ev.Row.Attributes["onmouseover"] = "this.style.cursor='hand';this.style.textDecoration='underline';";
                    ev.Row.Attributes["onmouseout"] = "this.style.textDecoration='none';";
                    for (int i = 0; i < ev.Row.Cells.Count; i++)
                    {
                        if (i == 0) continue;
                        ev.Row.Cells[i].Attributes["onclick"] = ClientScript.GetPostBackClientHyperlink(this.gdvDealers, "Select$" + ev.Row.RowIndex);
                    }

    3. UI result

    Asp.net javascript:__doPostBack('ctl00$MainContent$gdvDealers','Select$0')

  • 相关阅读:
    SpringBoot打包 jar文件太小 无jar
    公共dns
    SpringBoot解决跨域问题
    git学习-来自慕课网
    SpringBoot Value 'xxx' is not a valid duration
    Maven生成项目
    github-自我使用-滑稽
    jsonp示列
    mysqldump 备份和恢复整理
    myql二进制日志
  • 原文地址:https://www.cnblogs.com/webglcn/p/4806448.html
Copyright © 2011-2022 走看看