如何将DataGridView绑定列的True/false转换为是/否

//winform中是在  cellFormatting中进行处理       web中是在databound中

private void dataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
        {

            if (dataGridView1.Columns[e.ColumnIndex].Name == "uni_flag" && e.Value is Boolean && e.Value != null)
            {
                if (Convert.ToString(e.Value) == "True")
                {
                    e.Value = "是";
                }
                else if (Convert.ToString(e.Value) == "False")
                {
                    e.Value = "否";
                }
            }
       

        }

你可能感兴趣的:(Web,WinForm)