Is there a way to enable selection in a readonly textbox grid cell? So a user cannot edit the text but can select part of the text?
1 Answer, 1 is accepted
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 14 Nov 2016, 10:20 AM
Hello Jeroen,
Thank you for writing.
Read-only columns are not supposed to enter edit mode. However, note that you can set the ReadOnly property of the column to false, but make the editor read-only. Thus, you will be allowed to enter edit mode and select part of the text. Here is a sample code snippet:
RadTextBoxEditor tb = e.ActiveEditor as RadTextBoxEditor;
if (tb != null && this.radGridView1.CurrentColumn.Name == "ProductName")
{
RadTextBoxEditorElement el = tb.EditorElement as RadTextBoxEditorElement;
el.TextBoxItem.ReadOnly = true;
}
}
I hope this information helps. Should you have further questions I would be glad to help.
Regards,
Dess
Telerik by Progress
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.