对绑定的数据字段进行操作 如本地化字段的值

  GridView.RowDataBound 事件   在 GridView 控件中将数据行绑定到数据时发生。

  protected void gvEvents_ RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            Label lb = (Label) e.Row.FindControl("lblDoR");
            if (lb.Text == "True")
            {
                lb.Text = (string)base.GetGlobalResourceObject("Companys", "lblDoR");
            }
            else
            {
                lb.Text = (string)base.GetGlobalResourceObject("Companys", "lblDoR1");
            }
    }

你可能感兴趣的:(本地化)