zoukankan      html  css  js  c++  java
  • GridView的其他用法小总结

    GridView实现删除时弹出确认对话框:
    View Code
    1 if (e.Row.RowState == DataControlRowState.Normal || e.Row.RowState == DataControlRowState.Alternate)
    2 {
    3 ((LinkButton)e.Row.Cells[6].Controls[0]).Attributes.Add("onclick", "javascript:return confirm('你确认要删除:\"" + e.Row.Cells[1].Text + "\"吗?')");
    4 }

    如图

    DataView前自动生成编号

    同样也是RowDataBound方法加上下面一段代码就ok了

    View Code
    1 if (e.Row.RowIndex != -1)
    2 {
    3 int id = e.Row.RowIndex + 1;
    4 e.Row.Cells[0].Text = id.ToString();
    5 }
  • 相关阅读:
    R
    P
    O
    M
    二分算法的一些思考
    I
    H
    G
    5-46 新浪微博热门话题 (30分)——unfinished HASH
    BZOJ 1179: [Apio2009]Atm
  • 原文地址:https://www.cnblogs.com/wsl2011/p/2099481.html
Copyright © 2011-2022 走看看