zoukankan      html  css  js  c++  java
  • GridView数据替换,数字按要求替换文字

    可以在GrivdView的行绑定(RowDataBound)事件中改写
    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
    if (e.Row.RowType == DataControlRowType.DataRow)
    {
    string i = e.Row.Cells[1].Text; //Cells[I]表示列的索引,从0开始
    if (i == "1")
    {
    e.Row.Cells[1].Text = "男";
    }
    else
    {
    e.Row.Cells[1].Text = "女";
    }
    }
    }
    转自百度知道回答
  • 相关阅读:
    Tye exception
    DataSeeder
    angular
    认证Authentication
    MVC
    Ef Core
    工作单元
    VirtualFileSystem
    中间件
    日志
  • 原文地址:https://www.cnblogs.com/liziqiang/p/3396895.html
Copyright © 2011-2022 走看看