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

GridViewComboBoxColumn - Custom display values?

1 Answer 62 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Kenneth Jamieson
Top achievements
Rank 1
Kenneth Jamieson asked on 23 Feb 2010, 07:44 PM
I have a gridview column that looks like this...

 

 

 

<telerikGridView:GridViewComboBoxColumn  
            Header="Title" 
            UniqueName="Title" 
            DisplayMemberPath="Title" 
            SelectedValueMemberPath="" 
            DataMemberBinding="{Binding CmsPlayerVideo}" 
            GroupMemberPath="CmsPlayerVideo.Title" 
            SortMemberPath="CmsPlayerVideo.Title" 
            Width="*" 
            IsGroupable="False" 
            IsSortable="True" 
            IsFilterable="True" 
            IsReadOnly="False" 
> 

What I need to do is display a compound value in the combobox as the title is not guarenteed unique and it makes selection difficult. In another part of the code I have a normal Silverlight combobox that I customize this way...

    <ComboBox x:Name="cbPlayer" SelectedItem="{Binding CmsPlayer, Mode=TwoWay}">  
        <ComboBox.ItemTemplate> 
            <DataTemplate> 
                <StackPanel Orientation="Horizontal">  
                    <TextBlock Text="{Binding LastName}" /> 
                    <TextBlock Text=", " /> 
                    <TextBlock Text="{Binding FirstName}" /> 
                    <TextBlock Text=" - " /> 
                    <TextBlock Text="{Binding Email}" /> 
                </StackPanel> 
            </DataTemplate> 
        </ComboBox.ItemTemplate> 
    </ComboBox> 

What would be the similar construct for use within the RadGrid?

Ken

1 Answer, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 24 Feb 2010, 01:01 PM
Hello Kenneth Jamieson,

You have control over the visual appearance of the combo via the EditorStyle property of the column.

The attached example demonstrates this  in action ( see the last column ) .
It is for WPF  but I believe it can be  easily adapted for Silverlight as both RadGridVIew for SL and WPF  share a common API.

In case you have troubles adapting this to your project just let me know.

All the best,
Pavel Pavlov
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
Kenneth Jamieson
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Share this question
or