This is a migrated thread and some comments may be shown as answers.

Copying values from a cell?

1 Answer 34 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Loring Vogel
Top achievements
Rank 1
Loring Vogel asked on 06 Sep 2009, 10:41 PM
I am displaying search results in a RadGridView and need to allow the user to select parts of a cell and copy to the clipboard for further search use.

How can I allow the user to select text in a cell and copy it to the clipboard?

Thank you.

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 08 Sep 2009, 11:05 AM
Hello,

The only option I can think of is to use CellTemplate for all grid columns with TextBoxes. I've made for you small demo project to illustrate you how to achieve this - you can find it attached.

Here is the code:
<telerikGridView:RadGridView x:Name="RadGridView1" AutoGenerateColumns="False" IsReadOnly="True"
            <telerikGridView:RadGridView.Columns> 
                <telerikGridView:GridViewDataColumn Header="ID" DataMemberBinding="{Binding ID}"
                    <telerikGridView:GridViewDataColumn.CellTemplate> 
                        <DataTemplate> 
                            <TextBox BorderThickness="{x:Null}" Background="{x:Null}" Text="{Binding ID}"/> 
                        </DataTemplate> 
                    </telerikGridView:GridViewDataColumn.CellTemplate> 
                </telerikGridView:GridViewDataColumn> 
                <telerikGridView:GridViewDataColumn Header="Name" DataMemberBinding="{Binding Name}"
                    <telerikGridView:GridViewDataColumn.CellTemplate> 
                        <DataTemplate> 
                            <TextBox BorderThickness="{x:Null}" Background="{x:Null}" Text="{Binding Name}"/> 
                        </DataTemplate> 
                    </telerikGridView:GridViewDataColumn.CellTemplate> 
                </telerikGridView:GridViewDataColumn> 
            </telerikGridView:RadGridView.Columns> 
        </telerikGridView:RadGridView> 


Regards,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
Loring Vogel
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or