i have 6 column in which the first column is a textboxcell and the rest are checkboxes.
and i want to put the value of two dimensional array to the datagrid.
string[,] debugger={{"name","0","0","1","1","0"}};
0=false
1=true (i assigned false value and true value from the datagridview property window.
when i try this it gives me a format exception ?
grdFont.ColumnCount=6;
var row = new DataGridViewRow();
row.Cells.Add(new DataGridViewTextBoxCell()
{
Value = debugger[0]
});
row.Cells.Add(new DataGridViewCheckBoxCell()
{
Value = debugger[1]
});
row.Cells.Add(new DataGridViewCheckBoxCell()
{
Value = debugger[2]
});
row.Cells.Add(new DataGridViewCheckBoxCell()
{
Value = debugger[3]
});
row.Cells.Add(new DataGridViewCheckBoxCell()
{
Value = debugger[4]
});
row.Cells.Add(new DataGridViewCheckBoxCell()
{
Value = debugger[5]
});
grdFont.Rows.Add(row);
is there another way i can implement this?
0 is not equvalent of
falseand 1 is not equivalent oftrue. Write a function to convert these numbers toBooleanvalue:Use this function when you set a value to cell:
It’s a pretty basic realization, but I believe you got the idea