lundi 24 février 2020

Change DataGridView Column Cells from CheckBox to String

Okay, so I have a DataGridView in which the third column, index 2, is a checkbox column, with some checkboxes checked, and some checkboxes unchecked, but instead of that, i want to show a string value depending if the value of the cell is true or false.

This is the problem

My DataGridView DataSource is a DataTable. Here is the method that gets the datatable for the DataGridView.DataSource.

public static DataTable DevolverInfoFuncionarios()
        {
            DataTable dtFuncs = new DataTable();


            string select_all_Funcs = "select IDFuncionario, Nome, is_gerente from Funcionarios";
            using (SqlCommand sql_com = new SqlCommand(select_all_Funcs, conexao))
            {
                conexao.Open();
                SqlDataReader dr = sql_com.ExecuteReader();
                dtFuncs.Load(dr);
                conexao.Close();
            }

            return dtFuncs;
        }

Helpp




Aucun commentaire:

Enregistrer un commentaire