I'm trying to leave only one column of GridView
as ReadOnly
, I'm doing so:
if (id_crm == 0)
{
textBox2.Text = Convert.ToString(cod_crm());
DataTable dat_itens = new DataTable();
dat_itens.Columns.Add("ITEM", typeof(int));
dat_itens.Columns.Add("DESCRIÇÃO", typeof(string));
dat_itens.Columns.Add("DESCRIÇÃO NF", typeof(string));
dat_itens.Columns.Add("QUANTIDADE", typeof(int));
dat_itens.Columns.Add("OF ORIGEM", typeof(string));
gridControl1.DataSource = dat_itens;
gridView5.Columns[0].Width = 28;
gridView5.Columns[0].AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
gridView5.Columns["ITEM"].ReadOnly = true;
}
However, it displays an error: