i have dataset, which has 7 columns,
i have a datagrid, binded to above dataset,i have a boolean column,whose columnstyle is datagridviewcheckbox style, i want to set it to
datagridviewtextboxcolumn style,
so that when boolean values are displayed in datagrid, instead of checkbox,i want true/false text to be written as column values.
DataSet ds = daoDistrict.FillDistrictGrid(Convert.ToInt32(cbStateName.SelectedValue));
dgDistrict.DataSource = ds.Tables[0];
DataGridViewTextBoxColumn txtBxCol = new DataGridViewTextBoxColumn();
DataGridViewColumn tempCol = (DataGridViewColumn)dgDistrict.Columns[6];
txtBxCol = (DataGridViewTextBoxColumn)tempCol;
txtBxCol.Name = "IsActive";
txtBxCol.DataPropertyName = "IsActive";
txtBxCol.HeaderText = "Is--Active";
DataGridView dgv = txtBxCol.DataGridView;
bool val = txtBxCol.Displayed;
int ind = txtBxCol.DisplayIndex;
bool isDat = txtBxCol.IsDataBound;
txtBxCol.ValueType = txtBxCol.GetType();
above code throws cast exception, unable to cast DGVCheckbxcol to DGVtextbxcol
thanks in advance