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

GridViewComboBoxColumn

1 Answer 227 Views
GridView
This is a migrated thread and some comments may be shown as answers.
sarag
Top achievements
Rank 1
sarag asked on 03 Mar 2011, 12:19 AM
Hi,

I am using Telerik Q3 2010, blend 4, vs 2010.

i am using rad gridview  one of the column is Gridviewcombobox column, when i set the ItemContainerStyle of the combobox i am loosing data, when i click the dropdown instead of getting tubelist i am getting the object name. if i comment the ItemContainerStyle its working fine.

 please see the attached image.


<Style  TargetType="telerik:RadComboBox">
        <Setter Property="OpenDropDownOnFocus" Value="True"/>
        <!--<Setter Property="MinHeight" Value="50"/>-->
        <Setter Property="ItemContainerStyle" Value="{DynamicResource RadComboBoxItemStyle1}" />
          
        <Setter Property="MaxDropDownHeight" Value="500" />
          
    </Style>


<Style x:Key="RadComboBoxItemStyle1" TargetType="{x:Type telerik:RadComboBoxItem}">
            <Setter Property="Background" Value="Transparent" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type telerik:RadComboBoxItem}">
                        <Border x:Name="Background" BorderBrush="steelblue" BorderThickness="1" Background="{TemplateBinding Background}" Margin="5,2" CornerRadius="2">
                            <Grid>
                                <Rectangle x:Name="Highlight" Visibility="Collapsed">
                                    <Rectangle.Fill>
                                        <LinearGradientBrush EndPoint="0.5,1" MappingMode="RelativeToBoundingBox" StartPoint="0.5,0">
                                            <GradientStop Color="#FF5F9DD6" />
                                            <GradientStop Color="White" Offset="1" />
                                        </LinearGradientBrush>
                                    </Rectangle.Fill>
                                </Rectangle>
                                <ContentPresenter x:Name="Content" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" TextElement.Foreground="Black" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" OpacityMask="Black" Margin="2,10" />
                            </Grid>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsHighlighted" Value="True">
                                <Setter Property="Visibility" TargetName="Highlight" Value="Visible" />
                                <Setter Property="BorderBrush" TargetName="Background" Value="SteelBlue" />
                                <Setter Property="Background" Value="#FF001720" TargetName="Background" />
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Setter Property="HorizontalContentAlignment" Value="Left" />
            <Setter Property="VerticalContentAlignment" Value="Center" />
            <Setter Property="Padding" Value="3,1" />
            <Setter Property="SnapsToDevicePixels" Value="True" />
            <Setter Property="FocusVisualStyle" Value="{x:Null}" />
        </Style>

<telerik:GridViewComboBoxColumn DataMemberBinding="{Binding TubeType}"     
DisplayMemberPath="TubeType"  SelectedValueMemberPath="TubeType"  Header="Tube Type"  
MinWidth="200" EditTriggers="CellClick" />

1 Answer, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 07 Mar 2011, 08:53 AM
Hi sarag,

I have used the exact same code as the one you provided and everything works as expected. I am sending you the sample project I used for testing the case. Please take a look at it and let me know in case of any misunderstandings.
 

Greetings,
Maya
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
GridView
Asked by
sarag
Top achievements
Rank 1
Answers by
Maya
Telerik team
Share this question
or