Select Text in a ReadOnly RadGridView Cell
Environment
Product Version | 2022.2.621 |
Product | RadGridView for WPF |
Description
How to select the cell text when the GridView column is in readonly mode.
Solution
Define a custom CellTemplate
containing a read-only TextBox
element.
<telerik:GridViewDataColumn DataMemberBinding="{Binding Name}" IsReadOnly="True">
<telerik:GridViewDataColumn.CellTemplate>
<DataTemplate>
<TextBox IsReadOnly="True" Text="{Binding Name}" BorderThickness="0" Background="Transparent"/>
</DataTemplate>
</telerik:GridViewDataColumn.CellTemplate>
</telerik:GridViewDataColumn>