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

Copying rows by pressing Ctrl+C(problem with datatemplate)

1 Answer 24 Views
GridView
This is a migrated thread and some comments may be shown as answers.
luke
Top achievements
Rank 1
luke asked on 05 May 2010, 10:26 AM
Hi, after after selecting some rows, i would like copy it, but problem appear when my column look  like that

 <telerikGridView:GridViewDataColumn Header="Id" >
                                    <telerikGridView:GridViewDataColumn.CellTemplate>
                                        <DataTemplate>
                                            <TextBlock
               Text="{Binding UserId}"
               Margin="4"/>
                                        </DataTemplate>
                                    </telerikGridView:GridViewDataColumn.CellTemplate>
                                </telerikGridView:GridViewDataColumn>

instead of Id number its name of entity class ....

thanks in advance for help

1 Answer, 1 is accepted

Sort by
0
Accepted
Stefan Dobrev
Telerik team
answered on 05 May 2010, 02:07 PM
Hello Ɓukasz Hutyra,

You have to set the DataMemberBinding of the column. Something like this:
<telerikGridView:GridViewDataColumn Header="Id" DataMemberBinding="{Binding UserId}" >
    <telerikGridView:GridViewDataColumn.CellTemplate>
        <DataTemplate>
            <TextBlock
              Text="{Binding UserId}"
              Margin="4"/>
        </DataTemplate>
    </telerikGridView:GridViewDataColumn.CellTemplate>
</telerikGridView:GridViewDataColumn>

Regards,
Stefan Dobrev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
GridView
Asked by
luke
Top achievements
Rank 1
Answers by
Stefan Dobrev
Telerik team
Share this question
or