BoldDeskPremium customer service software with affordable pricing: $10 for 3 agents. Try it for free.
if(e.ColIndex > 1 && this.gdgMessages[e.RowIndex, 1].CellValue.ToString() == "TRUE")
You also have to make sure that this.gdgMessages[e.RowIndex, 1].CellValue.ToString() has the value "TRUE" and not "true" (for example). If this is a column of type bool, you can try testing ((bool)this.gdgMessages[e.RowIndex, 1].CellValue) which should be a boolean value unless it is null or DBNull.
If you also want to include column 1 in setting ReadOnly, then you should have a special case for column 1 since it is your test column. When e.ColIndex == 1, then test e.Style.Cellvalue instead of indexing the grid to get the cell value.
private void Model_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e) { if((e.ColIndex == 2 && e.Style.CellValue.ToString() == "TRUE") || ((e.ColIndex == 1 || e.ColIndex > 2) && this.gdgMessages[e.RowIndex,2].CellValue.ToString() == "TRUE")) { e.Style.ReadOnly = true; if(e.ColIndex == 4 || e.ColIndex == 5) { //Remove the date time picker e.Style.CellType = "TextBox"; } } }