BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
GridStyleInfo style = this.gridControl1[2,2];
style.CellType = "Static";
style.Text = "SomeText";
style.ReadOnly = true;
If you want a particular cell to be absolutely immutable (including to OLE DND), then you can handle SaveCellInfo, and not save the change. Make sure you subscribe to the event after you set the cell text otherwise, the change will not take.
//in formload GridStyleInfo style = this.gridControl1[2,2]; style.Text = "SomeText"; this.gridControl1.SaveCellInfo += new GridSaveCellInfoEventHandler(this.gridControl1_SaveCellInfo); //the handler private void gridControl1_SaveCellInfo(object sender, GridSaveCellInfoEventArgs e) { if(e.ColIndex == 2 && e.RowIndex == 2) { e.Handled = true; } }
private void Form1_Load(object sender, System.EventArgs e) { this.gridControl1.ChangeCells(GridRangeInfo.Cells(1,1,5,5), "abc"); this.gridControl1[2,2].BackColor = Color.LightBlue; this.gridControl1[2,2].ReadOnly = true; }