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

Multibind datacolumn

1 Answer 84 Views
This is a migrated thread and some comments may be shown as answers.
Nick Wood
Top achievements
Rank 1
Nick Wood asked on 04 Jun 2010, 05:02 AM
Hi All

Is it possible to bind the one column to 2 fields?

The scenario is that we have a sales rep, which requires both first and last names in the one column. I have managed this with a datatemplate:
<!-- Sales Rep Name Template -->
        <DataTemplate x:Key="SalesRepNameTemplate">
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="{Binding user.first_name}" />
                <TextBlock Text=" " />
                <TextBlock Text="{Binding user.last_name}" />

<telerikGridView:GridViewDataColumn Header="Sales Rep" CellTemplate="{StaticResource SalesRepNameTemplate}" />

But the issue is that this column can now not be sorted or grouped or filtered, which is also required.

How else would this be possible while still retaining sorting etc?

1 Answer, 1 is accepted

Sort by
Veselin Vasilev
Telerik team
answered on 04 Jun 2010, 07:41 AM
Hello Nick Wood,

Please set the DataMemberBinding property of the column to the field you want to filter/sort against.

<telerikGridView:GridViewDataColumn Header="Sales Rep" CellTemplate="{StaticResource SalesRepNameTemplate}" DataMemberBinding="{Binding FirstName}" />

Kind regards,
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.
Asked by
Nick Wood
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Share this question