Telerik Forums
UI for WPF Forum
3 answers
184 views
Is it possible to do substring checks?
Our users are used to excel and vba formulas so if they could do something like...

Left(string,length<int>)
Right(string,length<int>)
Mid(string,start<int>,length<int>)

Example usage:
IF((Left(Column,3) = "ABC" OR Right(Column,3) = "DEF"),True,False)
Guru
Top achievements
Rank 2
 answered on 28 Jul 2011
1 answer
168 views

Hello

Is there indication to know when user clicks the Group Footers of the grid?

And then get the aggregation result of the grid?

Best regards

Ehud

Vanya Pavlova
Telerik team
 answered on 28 Jul 2011
1 answer
97 views

Hello

We have coded ui test in our application

And after we  download the new dlls RadControls_for_WPF40_2011_2_0712_Dev

We get this exception from the data pager and the application crash

In the old version of dlls 0427.40 this not happened

This the exception :

System.ArgumentNullException: Value cannot be null.

Parameter name: source

   at System.Linq.Enumerable.Where[TSource](IEnumerable`1 source, Func`2 predicate)

   at Telerik.Windows.Controls.Data.DataPager.DataPagerAutomationPeer.GetChildrenCore()

   at System.Windows.Automation.Peers.AutomationPeer.EnsureChildren()

   at System.Windows.Automation.Peers.AutomationPeer.UpdateChildrenInternal(Int32 invalidateLimit)

   at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()

   at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()

   at System.Windows.ContextLayoutManager.fireAutomationEvents()

   at System.Windows.ContextLayoutManager.UpdateLayout()

   at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)

   at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()

   at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)

   at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)

   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)

   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)

What is the problem?

Best regards

Ehud

 

Ivan Ivanov
Telerik team
 answered on 28 Jul 2011
1 answer
1.2K+ views
Greetings-
I am trying to tailor a RadComboBox to look behave visually like our mock ups. I have achieved about 80% of what I am looking to do, but I could use some assistance with the last part...as I am not even sure it is possible to do.


I would like the foreground color or font face to be white on the combo box, but have the list below it be black. The reason is that we have a dark gradient for the RadComboBox style, but a white background for the dropdown list. Is there any way to achieve this through the new version of the controls in Expression Blend or through XAML?

I have pasted my XAML for MainWindow and AppResources so you can see where I am at thus far.

Your help would be much appreciated.
Regards...

<Window
    x:Class="Controls.MainWindow"
    x:Name="Window"
    Title="MainWindow"
    Width="640" Height="480">
 
    <Grid x:Name="LayoutRoot">
        <!--<telerik:RadGridView Style="{DynamicResource RadGridView}"></telerik:RadGridView-->
 
        <telerik:RadComboBox EmptyText="Please Select from List" Foreground="{DynamicResource ComboBoxText}" Height="25" Width="200" Style="{DynamicResource GreenComboBoxStyle}" FontWeight="Bold" Padding="5,0">
                <telerik:RadComboBoxItem Foreground="Black">Item One</telerik:RadComboBoxItem>
                <telerik:RadComboBoxItem Foreground="Black">Item Two</telerik:RadComboBoxItem>
                <telerik:RadComboBoxItem Foreground="Black">Item Three</telerik:RadComboBoxItem>
                <telerik:RadComboBoxItem Foreground="Black">Item Foure</telerik:RadComboBoxItem>
        </telerik:RadComboBox>
 
    </Grid>
</Window>
<ResourceDictionary
    xmlns:Telerik_Windows_Controls_Chromes="clr-namespace:Telerik.Windows.Controls.Chromes;assembly=Telerik.Windows.Controls">
     
    <LinearGradientBrush x:Key="GreenComboBox" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FF2E7015" Offset="0"/>
        <GradientStop Color="#FF5EAD42" Offset="1"/>
    </LinearGradientBrush>
    <SolidColorBrush x:Key="GreenComboBoxBorder" Color="#FFADADAD"/>
     
    <LinearGradientBrush x:Key="BlueGradientHeader" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FF0387CE" Offset="0"/>
        <GradientStop Color="#FF95CDEB" Offset="1"/>
    </LinearGradientBrush>
 
     
    <Style x:Key="GreenComboBoxStyle" TargetType="{x:Type telerik:RadComboBox}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type telerik:RadComboBox}">
                    <Grid x:Name="VisualRoot">
                        <Border Background="{TemplateBinding Background}" CornerRadius="1" IsHitTestVisible="False"/>
                        <telerik:RadToggleButton x:Name="PART_DropDownButton" ClickMode="Press" IsTabStop="False" Margin="0" Padding="0">
                            <telerik:StyleManager.Theme>
                                <telerik:Office_BlackTheme/>
                            </telerik:StyleManager.Theme>
                            <telerik:RadToggleButton.Template>
                                <ControlTemplate TargetType="{x:Type telerik:RadToggleButton}">
                                    <ContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}"/>
                                </ControlTemplate>
                            </telerik:RadToggleButton.Template>
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <Telerik_Windows_Controls_Chromes:ButtonChrome x:Name="GreenComboBox" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="2" CornerRadius="1" RenderMouseOver="{TemplateBinding IsMouseOver}" RenderPressed="{TemplateBinding IsDropDownOpen}" RenderFocused="{TemplateBinding IsFocused}" RenderEnabled="{TemplateBinding IsEnabled}">
                                    <telerik:StyleManager.Theme>
                                        <telerik:Office_BlackTheme/>
                                    </telerik:StyleManager.Theme>
                                </Telerik_Windows_Controls_Chromes:ButtonChrome>
                                <ContentControl x:Name="DropDownIcon" Background="White" Grid.Column="1" Foreground="Black" IsTabStop="False">
                                    <ContentControl.Template>
                                        <ControlTemplate TargetType="{x:Type ContentControl}">
                                            <Grid Margin="5,0">
                                                <Path x:Name="BackgroundIcon" Data="M0,0L2,0 1,1z" Fill="{TemplateBinding Background}" Height="3" Margin="0,2,0,0" Stretch="Fill" Width="5"/>
                                                <Path x:Name="ForegroundIcon" Data="M0,0L2,0 1,1z" Fill="{TemplateBinding Foreground}" Height="3" Margin="0,1" Stretch="Fill" Width="5"/>
                                            </Grid>
                                        </ControlTemplate>
                                    </ContentControl.Template>
                                </ContentControl>
                                <ContentPresenter x:Name="Content" ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" Content="{TemplateBinding SelectionBoxItem}" Grid.Column="0" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" IsHitTestVisible="False" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                            </Grid>
                        </telerik:RadToggleButton>
                        <Popup x:Name="PART_Popup" AllowsTransparency="True" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}">
                            <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="White" CornerRadius="1" MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{TemplateBinding MinDropDownWidth}">
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="*"/>
                                    </Grid.RowDefinitions>
                                    <telerik:RadButton x:Name="PART_ClearButton" Content="{TemplateBinding ClearSelectionButtonContent}" Margin="-1,-1,-1,0" Grid.Row="0" Visibility="{TemplateBinding ClearSelectionButtonVisibility}">
                                        <telerik:StyleManager.Theme>
                                            <telerik:Office_BlackTheme/>
                                        </telerik:StyleManager.Theme>
                                    </telerik:RadButton>
                                    <ScrollViewer x:Name="PART_ScrollViewer" BorderThickness="0" CanContentScroll="True" Padding="0,1,0,0" Grid.Row="1" VerticalScrollBarVisibility="Auto">
                                        <telerik:StyleManager.Theme>
                                            <telerik:Office_BlackTheme/>
                                        </telerik:StyleManager.Theme>
                                        <ItemsPresenter/>
                                    </ScrollViewer>
                                </Grid>
                            </Border>
                        </Popup>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Opacity" TargetName="Content" Value="0.5"/>
                            <Setter Property="Foreground" TargetName="DropDownIcon" Value="#FF8D8D8D"/>
                            <Setter Property="Background" TargetName="DropDownIcon" Value="White"/>
                        </Trigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsEnabled" Value="True"/>
                                <Condition Property="IsMouseOver" Value="True"/>
                            </MultiTrigger.Conditions>
                            <Setter Property="Foreground" TargetName="DropDownIcon" Value="Black"/>
                            <Setter Property="Background" TargetName="DropDownIcon" Value="White"/>
                        </MultiTrigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsEnabled" Value="True"/>
                                <Condition Property="IsDropDownOpen" Value="True"/>
                            </MultiTrigger.Conditions>
                            <Setter Property="Foreground" TargetName="DropDownIcon" Value="Black"/>
                            <Setter Property="Background" TargetName="DropDownIcon" Value="White"/>
                        </MultiTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="EditableTemplate">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type telerik:RadComboBox}">
                    <Grid x:Name="VisualRoot">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <Border x:Name="Background" Background="White" Grid.Column="0" CornerRadius="1,0,0,1" IsHitTestVisible="False"/>
                        <Border Background="{TemplateBinding Background}" Grid.ColumnSpan="2" CornerRadius="1" IsHitTestVisible="False"/>
                        <Border x:Name="Border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="2" CornerRadius="1" IsHitTestVisible="False"/>
                        <Border x:Name="MouseOverVisual" BorderBrush="#FFFFC92B" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="2" CornerRadius="1" IsHitTestVisible="False" Opacity="0" Visibility="Collapsed"/>
                        <telerik:PickerTextBox x:Name="PART_EditableTextBox" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Grid.Column="0" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" IsReadOnly="{TemplateBinding IsReadOnly}" Padding="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}">
                            <telerik:StyleManager.Theme>
                                <telerik:Office_BlackTheme/>
                            </telerik:StyleManager.Theme>
                        </telerik:PickerTextBox>
                        <Border x:Name="FocusVisual" BorderBrush="#FFFFC92B" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="2" CornerRadius="1" IsHitTestVisible="False" Visibility="Collapsed">
                            <Border BorderBrush="Transparent" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="0"/>
                        </Border>
                        <telerik:RadToggleButton x:Name="PART_DropDownButton" ClickMode="Press" Grid.Column="1" IsTabStop="False" Margin="0" Padding="0">
                            <telerik:StyleManager.Theme>
                                <telerik:Office_BlackTheme/>
                            </telerik:StyleManager.Theme>
                            <telerik:RadToggleButton.Template>
                                <ControlTemplate TargetType="{x:Type telerik:RadToggleButton}">
                                    <ContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}"/>
                                </ControlTemplate>
                            </telerik:RadToggleButton.Template>
                            <Grid>
                                <Telerik_Windows_Controls_Chromes:ButtonChrome x:Name="GreenComboBox" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="0,1,1,0" RenderMouseOver="{Binding IsMouseOver, ElementName=PART_DropDownButton}" RenderPressed="{TemplateBinding IsDropDownOpen}" RenderFocused="{TemplateBinding IsKeyboardFocusWithin}" RenderActive="{TemplateBinding IsMouseOver}" RenderEnabled="{TemplateBinding IsEnabled}">
                                    <telerik:StyleManager.Theme>
                                        <telerik:Office_BlackTheme/>
                                    </telerik:StyleManager.Theme>
                                </Telerik_Windows_Controls_Chromes:ButtonChrome>
                                <ContentControl x:Name="DropDownIcon" Background="White" Grid.Column="1" Foreground="Black" IsTabStop="False">
                                    <ContentControl.Template>
                                        <ControlTemplate TargetType="{x:Type ContentControl}">
                                            <Grid Margin="5,0">
                                                <Path x:Name="BackgroundIcon" Data="M0,0L2,0 1,1z" Fill="{TemplateBinding Background}" Height="3" Margin="0,2,0,0" Stretch="Fill" Width="5"/>
                                                <Path x:Name="ForegroundIcon" Data="M0,0L2,0 1,1z" Fill="{TemplateBinding Foreground}" Height="3" Margin="0,1" Stretch="Fill" Width="5"/>
                                            </Grid>
                                        </ControlTemplate>
                                    </ContentControl.Template>
                                </ContentControl>
                            </Grid>
                        </telerik:RadToggleButton>
                        <TextBlock x:Name="Watermark" HorizontalAlignment="Left" IsHitTestVisible="False" Margin="5,0,0,0" Opacity="0.5" Text="{TemplateBinding EmptyText}" Visibility="Collapsed" VerticalAlignment="Center"/>
                        <Popup x:Name="PART_Popup" AllowsTransparency="True" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}">
                            <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="White" CornerRadius="1" MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{TemplateBinding MinDropDownWidth}">
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="*"/>
                                    </Grid.RowDefinitions>
                                    <telerik:RadButton x:Name="PART_ClearButton" Content="{TemplateBinding ClearSelectionButtonContent}" Margin="-1,-1,-1,0" Grid.Row="0" Visibility="{TemplateBinding ClearSelectionButtonVisibility}">
                                        <telerik:StyleManager.Theme>
                                            <telerik:Office_BlackTheme/>
                                        </telerik:StyleManager.Theme>
                                    </telerik:RadButton>
                                    <ScrollViewer x:Name="PART_ScrollViewer" BorderThickness="0" CanContentScroll="True" Padding="0,1,0,0" Grid.Row="1" VerticalScrollBarVisibility="Auto">
                                        <telerik:StyleManager.Theme>
                                            <telerik:Office_BlackTheme/>
                                        </telerik:StyleManager.Theme>
                                        <ItemsPresenter/>
                                    </ScrollViewer>
                                </Grid>
                            </Border>
                        </Popup>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="BorderBrush" TargetName="Border" Value="#FF989898"/>
                            <Setter Property="Foreground" TargetName="PART_EditableTextBox" Value="#FF8D8D8D"/>
                            <Setter Property="Foreground" TargetName="DropDownIcon" Value="#FF8D8D8D"/>
                            <Setter Property="Background" TargetName="DropDownIcon" Value="White"/>
                            <Setter Property="BorderBrush" TargetName="Border" Value="#FF989898"/>
                            <Setter Property="Background" TargetName="Background" Value="#FFE0E0E0"/>
                        </Trigger>
                        <Trigger Property="IsWatermarkVisible" Value="True">
                            <Setter Property="Visibility" TargetName="Watermark" Value="Visible"/>
                        </Trigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsEnabled" Value="True"/>
                                <Condition Property="IsMouseOver" Value="True"/>
                            </MultiTrigger.Conditions>
                            <MultiTrigger.EnterActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="MouseOverVisual">
                                            <LinearDoubleKeyFrame KeyTime="0:0:0.115" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="MouseOverVisual">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </BeginStoryboard>
                            </MultiTrigger.EnterActions>
                            <MultiTrigger.ExitActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="MouseOverVisual">
                                            <LinearDoubleKeyFrame KeyTime="0:0:0.15" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="MouseOverVisual">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0.15">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </BeginStoryboard>
                            </MultiTrigger.ExitActions>
                            <Setter Property="Foreground" TargetName="DropDownIcon" Value="Black"/>
                            <Setter Property="Background" TargetName="DropDownIcon" Value="White"/>
                        </MultiTrigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsEnabled" Value="True"/>
                                <Condition Property="IsDropDownOpen" Value="True"/>
                            </MultiTrigger.Conditions>
                            <Setter Property="BorderBrush" TargetName="Border">
                                <Setter.Value>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="#FF282828"/>
                                        <GradientStop Color="#FF5F5F5F" Offset="1"/>
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Foreground" TargetName="DropDownIcon" Value="Black"/>
                            <Setter Property="Background" TargetName="DropDownIcon" Value="White"/>
                        </MultiTrigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsKeyboardFocusWithin" Value="True"/>
                                <Condition Property="IsDropDownOpen" Value="False"/>
                            </MultiTrigger.Conditions>
                            <Setter Property="Visibility" TargetName="FocusVisual" Value="Visible"/>
                        </MultiTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="NonEditableTemplate">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type telerik:RadComboBox}">
                    <Grid x:Name="VisualRoot">
                        <Border Background="{TemplateBinding Background}" CornerRadius="1" IsHitTestVisible="False"/>
                        <telerik:RadToggleButton x:Name="PART_DropDownButton" ClickMode="Press" IsTabStop="False" Margin="0" Padding="0" Background="{DynamicResource GreenComboBox}">
                            <telerik:StyleManager.Theme>
                                <telerik:Office_BlackTheme/>
                            </telerik:StyleManager.Theme>
                            <telerik:RadToggleButton.Template>
                                <ControlTemplate TargetType="{x:Type telerik:RadToggleButton}">
                                    <ContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}"/>
                                </ControlTemplate>
                            </telerik:RadToggleButton.Template>
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <Telerik_Windows_Controls_Chromes:ButtonChrome x:Name="GreenComboBox" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="2" CornerRadius="1" RenderMouseOver="{TemplateBinding IsMouseOver}" RenderPressed="{TemplateBinding IsDropDownOpen}" RenderFocused="{TemplateBinding IsFocused}" RenderEnabled="{TemplateBinding IsEnabled}" Background="{DynamicResource GreenComboBox}">
                                    <telerik:StyleManager.Theme>
                                        <telerik:Office_BlackTheme/>
                                    </telerik:StyleManager.Theme>
                                </Telerik_Windows_Controls_Chromes:ButtonChrome>
                                <ContentControl x:Name="DropDownIcon" Background="White" Grid.Column="1" Foreground="Black" IsTabStop="False">
                                    <ContentControl.Template>
                                        <ControlTemplate TargetType="{x:Type ContentControl}">
                                            <Grid Margin="5,0">
                                                <Path x:Name="BackgroundIcon" Data="M0,0L2,0 1,1z" Fill="{TemplateBinding Background}" Height="3" Margin="0,2,0,0" Stretch="Fill" Width="5"/>
                                                <Path x:Name="ForegroundIcon" Data="M0,0L2,0 1,1z" Fill="{TemplateBinding Foreground}" Height="3" Margin="0,1" Stretch="Fill" Width="5"/>
                                            </Grid>
                                        </ControlTemplate>
                                    </ContentControl.Template>
                                </ContentControl>
                                <ContentPresenter x:Name="Content" ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" Content="{TemplateBinding SelectionBoxItem}" Grid.Column="0" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" IsHitTestVisible="False" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                            </Grid>
                        </telerik:RadToggleButton>
                        <Popup x:Name="PART_Popup" AllowsTransparency="True" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}">
                            <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="White" CornerRadius="1" MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{TemplateBinding MinDropDownWidth}">
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="*"/>
                                    </Grid.RowDefinitions>
                                    <telerik:RadButton x:Name="PART_ClearButton" Content="{TemplateBinding ClearSelectionButtonContent}" Margin="-1,-1,-1,0" Grid.Row="0" Visibility="{TemplateBinding ClearSelectionButtonVisibility}" Background="{DynamicResource GreenComboBox}">
                                        <telerik:StyleManager.Theme>
                                            <telerik:Office_BlackTheme/>
                                        </telerik:StyleManager.Theme>
                                    </telerik:RadButton>
                                    <ScrollViewer x:Name="PART_ScrollViewer" BorderThickness="0" CanContentScroll="True" Padding="0,1,0,0" Grid.Row="1" VerticalScrollBarVisibility="Auto">
                                        <telerik:StyleManager.Theme>
                                            <telerik:Office_BlackTheme/>
                                        </telerik:StyleManager.Theme>
                                        <ItemsPresenter/>
                                    </ScrollViewer>
                                </Grid>
                            </Border>
                        </Popup>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Opacity" TargetName="Content" Value="0.5"/>
                            <Setter Property="Foreground" TargetName="DropDownIcon" Value="#FF8D8D8D"/>
                            <Setter Property="Background" TargetName="DropDownIcon" Value="White"/>
                        </Trigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsEnabled" Value="True"/>
                                <Condition Property="IsMouseOver" Value="True"/>
                            </MultiTrigger.Conditions>
                            <Setter Property="Foreground" TargetName="DropDownIcon" Value="Black"/>
                            <Setter Property="Background" TargetName="DropDownIcon" Value="White"/>
                        </MultiTrigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsEnabled" Value="True"/>
                                <Condition Property="IsDropDownOpen" Value="True"/>
                            </MultiTrigger.Conditions>
                            <Setter Property="Foreground" TargetName="DropDownIcon" Value="Black"/>
                            <Setter Property="Background" TargetName="DropDownIcon" Value="White"/>
                        </MultiTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="MinHeight" Value="22"/>
        <Setter Property="Padding" Value="4,0"/>
        <Setter Property="Foreground" Value="Black"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderBrush" Value="#FFADADAD"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
    </Style>
     
     
    <Style x:Key="RadGridView" TargetType="{x:Type telerik:RadGridView}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type telerik:RadGridView}">
                    <AdornerDecorator>
                        <Border x:Name="PART_MasterGridContainer" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}">
                            <Grid x:Name="HierrarchyBackground" Background="{TemplateBinding Background}">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition/>
                                    <ColumnDefinition x:Name="ScrollBarColumn" MinWidth="0" Width="0"/>
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition x:Name="PART_AttachedBehaviorRow" Height="Auto"/>
                                    <RowDefinition/>
                                    <RowDefinition x:Name="ScrollBarRow" Height="0" MinHeight="0"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <telerik:GridViewGroupPanel x:Name="PART_GroupPanel" BorderBrush="#FF848484" Background="{DynamicResource GreenComboBox}" Grid.ColumnSpan="2" Foreground="White" IsTabStop="False" Grid.Row="0" FontSize="14" FontFamily="Segoe UI">
                                    <telerik:StyleManager.Theme>
                                        <telerik:Office_BlackTheme/>
                                    </telerik:StyleManager.Theme>
                                </telerik:GridViewGroupPanel>
                                <telerik:GridViewScrollViewer x:Name="PART_ItemsScrollViewer" Background="Transparent" CanContentScroll="True" Grid.ColumnSpan="2" Grid.Row="2" Grid.RowSpan="2" Style="{DynamicResource GridViewScrollViewerStyle}">
                                    <telerik:GridViewScrollViewer.FooterRow>
                                        <telerik:GridViewFooterRow x:Name="PART_FooterRow" IsTabStop="False" IndentLevel="{TemplateBinding GroupCount}">
                                            <telerik:StyleManager.Theme>
                                                <telerik:Office_BlackTheme/>
                                            </telerik:StyleManager.Theme>
                                        </telerik:GridViewFooterRow>
                                    </telerik:GridViewScrollViewer.FooterRow>
                                    <telerik:GridViewScrollViewer.HeaderRow>
                                        <telerik:GridViewHeaderRow x:Name="PART_HeaderRow" IsTabStop="False" IndentLevel="{TemplateBinding GroupCount}" Background="{DynamicResource BlueGradientHeader}">
                                        </telerik:GridViewHeaderRow>
                                    </telerik:GridViewScrollViewer.HeaderRow>
                                    <telerik:GridViewScrollViewer.NewRow>
                                        <telerik:GridViewNewRow x:Name="PART_AddNewRow" IsTabStop="False" IndentLevel="{TemplateBinding GroupCount}" Visibility="Collapsed">
                                            <telerik:StyleManager.Theme>
                                                <telerik:Office_BlackTheme/>
                                            </telerik:StyleManager.Theme>
                                        </telerik:GridViewNewRow>
                                    </telerik:GridViewScrollViewer.NewRow>
 
                                    <telerik:GridViewVirtualizingPanel x:Name="PART_GridViewVirtualizingPanel"/>
                                </telerik:GridViewScrollViewer>
                                <telerik:ScrollPositionIndicator x:Name="PART_ScrollPositionIndicator" Grid.ColumnSpan="2" ContentTemplate="{TemplateBinding ScrollPositionIndicatorTemplate}" HorizontalAlignment="Right" IsHitTestVisible="False" IsTabStop="False" Margin="0,0,28,0" Grid.Row="2">
 
                                    <telerik:ScrollPositionIndicator.Visibility>
                                        <Binding Mode="TwoWay" Path="IsScrolling" RelativeSource="{RelativeSource TemplatedParent}">
                                            <Binding.Converter>
                                                <telerik:BooleanToVisibilityConverter/>
                                            </Binding.Converter>
                                        </Binding>
                                    </telerik:ScrollPositionIndicator.Visibility>
                                </telerik:ScrollPositionIndicator>
                                <Border x:Name="PART_FrozenColumnsPreview" Background="#33000000" HorizontalAlignment="Left" Grid.Row="1" Grid.RowSpan="4" Visibility="Collapsed" VerticalAlignment="Stretch" Width="6"/>
                                <telerik:GridViewLoadingIndicator x:Name="PART_GridViewLoadingIndicator" Grid.ColumnSpan="2" IsTabStop="False" Grid.RowSpan="4" Visibility="Collapsed">
                                    <telerik:StyleManager.Theme>
                                        <telerik:Office_BlackTheme/>
                                    </telerik:StyleManager.Theme>
                                </telerik:GridViewLoadingIndicator>
                            </Grid>
                        </Border>
                    </AdornerDecorator>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsBusy" Value="True">
                            <Setter Property="Visibility" TargetName="PART_GridViewLoadingIndicator" Value="Visible"/>
                        </Trigger>
                        <Trigger Property="IsBusy" Value="False">
                            <Setter Property="Visibility" TargetName="PART_GridViewLoadingIndicator" Value="Collapsed"/>
                        </Trigger>
                        <Trigger Property="ShowColumnFooters" Value="False">
                            <Setter Property="Visibility" TargetName="PART_FooterRow" Value="Collapsed"/>
                        </Trigger>
                        <Trigger Property="ShowColumnHeaders" Value="False">
                            <Setter Property="Visibility" TargetName="PART_HeaderRow" Value="Collapsed"/>
                        </Trigger>
                        <Trigger Property="ShowGroupPanel" Value="False">
                            <Setter Property="Visibility" TargetName="PART_GroupPanel" Value="Collapsed"/>
                        </Trigger>
                        <Trigger Property="ComputedVerticalScrollBarVisibility" SourceName="PART_ItemsScrollViewer" Value="Collapsed">
                            <Setter Property="Width" TargetName="ScrollBarColumn" Value="0"/>
                        </Trigger>
                        <Trigger Property="ComputedHorizontalScrollBarVisibility" SourceName="PART_ItemsScrollViewer" Value="Collapsed">
                            <Setter Property="Height" TargetName="ScrollBarRow" Value="0"/>
                            <Setter Property="Grid.RowSpan" TargetName="PART_ItemsScrollViewer" Value="1"/>
                        </Trigger>
                        <Trigger Property="ShowInsertRow" Value="True">
                            <Setter Property="Visibility" TargetName="PART_AddNewRow" Value="Visible"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Background" Value="White"/>
        <Setter Property="BorderBrush" Value="#FF848484"/>
        <Setter Property="Foreground" Value="Black"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="AlternateRowBackground" Value="#FFF4F4F4"/>
        <Setter Property="VerticalGridLinesBrush" Value="#FFCBCBCB"/>
        <Setter Property="HorizontalGridLinesBrush" Value="#FFCBCBCB"/>
        <Setter Property="GroupPanelBackground">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FFDFDFDF" Offset="1"/>
                    <GradientStop Color="#FFBABABA"/>
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="GroupPanelForeground" Value="Black"/>
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
        <Setter Property="VerticalAlignment" Value="Stretch"/>
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
    </Style>
    <Style x:Key="GridViewScrollViewerStyle" TargetType="{x:Type telerik:GridViewScrollViewer}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type telerik:GridViewScrollViewer}">
                    <Grid x:Name="PART_RootPanel" Background="{TemplateBinding Background}">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <ScrollContentPresenter x:Name="PART_ScrollContentPresenter" CanContentScroll="{TemplateBinding CanContentScroll}" CanHorizontallyScroll="False" CanVerticallyScroll="False" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" Grid.Row="2"/>
                        <ScrollBar x:Name="PART_VerticalScrollBar" BorderThickness="1,0,0,0" Grid.Column="1" IsTabStop="False" Maximum="{TemplateBinding ScrollableHeight}" Minimum="0" Orientation="Vertical" Grid.Row="0" Grid.RowSpan="4" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportHeight}">
                            <telerik:StyleManager.Theme>
                                <telerik:Office_BlackTheme/>
                            </telerik:StyleManager.Theme>
                        </ScrollBar>
                        <ScrollBar x:Name="PART_HorizontalScrollBar" BorderThickness="0,1,0,0" Grid.Column="0" IsTabStop="False" Maximum="{TemplateBinding ScrollableWidth}" Minimum="0" Orientation="Horizontal" Grid.Row="4" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportWidth}">
                            <telerik:StyleManager.Theme>
                                <telerik:Office_BlackTheme/>
                            </telerik:StyleManager.Theme>
                        </ScrollBar>
                        <Rectangle Grid.Column="1" Grid.Row="4">
                            <Rectangle.Fill>
                                <RadialGradientBrush Center="0,0" GradientOrigin="0,0" RadiusY="1" RadiusX="1">
                                    <GradientStop Color="#FF848484" Offset="0.066"/>
                                    <GradientStop Color="#FFBFBFBF" Offset="0.066"/>
                                    <GradientStop Color="#FFF0F0F0" Offset="0.29"/>
                                </RadialGradientBrush>
                            </Rectangle.Fill>
                        </Rectangle>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <SolidColorBrush x:Key="ComboBoxText" Color="White"/>
</ResourceDictionary>
Dani
Telerik team
 answered on 28 Jul 2011
7 answers
572 views
The custom toolip example has a TargetType and no key so it overrides all tooltips. How can I just target the Appointment with a custom toolip?

Thanks,
Rod
Dani
Telerik team
 answered on 28 Jul 2011
7 answers
344 views
Hi,
I get an exception when i add theses lines in my xaml :
<telerik:ChartArea.AxisX>
    <telerik:AxisX x:Uid="telerik:AxisX_2"
            AxisLabelsVisibility="Collapsed"
            MajorTicksVisibility="Collapsed"
            MinorTicksVisibility="Collapsed" />
</telerik:ChartArea.AxisX>

If remove them the chart is correctly displayed. Is it the right manner to hide all the ticks ?
I want the lightest graph possible : only the bar with the value number in it, no legend, no title, no tick, nothing else,...

Any help ?

- Cedric -

Here are the complete files:

The Xaml:

and the code of the ViewModel:
public class MainViewModel : ViewModelBase
{
    public MainViewModel()
    {
        this.Items = new List<Item>()
    {
        new Item() 
        
            Level = 1, 
            Text ="AAAA"
            StatusGroup = new List<StatusPerformance>()
            {
                new StatusPerformance("Success", new List<Performance>() 
                {
                    new Performance() { Name="TMI", Count=76},
                    new Performance() { Name="TXT", Count=39}
                }),
                new StatusPerformance("Misrecognition", new List<Performance>() 
                {
                    new Performance() { Name="TMI", Count=15},
                    new Performance() { Name="TXT", Count=33}
                }),
                new StatusPerformance("Unknown", new List<Performance>() 
                {
                    new Performance() { Name="TMI", Count=62}
                })
            }
        },
        new Item() { Level = 2, Text ="BBBB"},
        new Item() { Level = 3, Text ="CCCC"},
        new Item() { Level = 4, Text ="DDDD"},
    };
    }
  
    public IList<Item> Items { get; private set; }
}
  
public class Item : ViewModelBase
{
    private TileStateEnum tileState;
    public int Level { get; set; }
    public string Text { get; set; }
    public TileStateEnum TileStateProp
    {
        get
        {
            return this.tileState;
        }
  
        set
        {
            if (this.tileState != value)
            {
                this.tileState = value;
                this.NotifyPropertyChanged("TileStateProp");
            }
        }
    }
  
    public List<StatusPerformance> StatusGroup { get; set; }
}
  
public class StatusPerformance : List<Performance>
{
    public StatusPerformance(string status, IList<Performance> performances)
    {
        this.Status = status;
        this.AddRange(performances);
    }
    public string Status { get; private set; }
}
  
public class Performance
{
    public string Name { get; set; }
    public int Count { get; set; }
}


Cedric
Top achievements
Rank 1
 answered on 28 Jul 2011
1 answer
152 views
Hello,

How can i make the DataFormComboBoxField editable (also with autocomplete) ?

Pavel Pavlov
Telerik team
 answered on 28 Jul 2011
0 answers
105 views
i have resolved :D close it please
nunzio
Top achievements
Rank 1
 asked on 28 Jul 2011
3 answers
349 views
I have a data class, Category, which has a property Children. This hierarchy, from a root Category node is bound to a TreeView. Category.Name is what displays for the Category. TreeView currently works fine.

What I need to figure out how to do is raise an edit event when the user makes a modification of the display value. I do not want to actually have anything edit the underlying bound value, until I do it myself.

I have tried with and without an EditItemTemplate. In the RadTreeView.Edited event, Source is set to the Category instance itself. OriginalSource is set to the RadTreeViewItem. NewText and OldText are both null (deprecated.) OldValue and NewValue are set to teh Category instance itself. And the Category.Name property has been edited. OldValue.Name and NewValue.Name are both the new value. Of course. Since it's set to the instance itself, there's no way to distuinguish between the before and after states.

What the heck can I do here? I thought I'd just use an EditItemTemplate, with a custom TextBox, in order to capture the new value, and set the Binding.Mode of the HierarchalDataTemplate to OneWay, to prevent it from being changed. However, now I have no way in the Edited event to retrieve the new value. I can't find the TextBox of the EditItemTemplate anywhere underneath RadTreeViewItem, and the OldValue and NewValue are of course still set to the Category itself (which is no longer altered, at least.)

Help?
Kiril Stanoev
Telerik team
 answered on 28 Jul 2011
6 answers
161 views
Hi,

We are hosting RadScheduleView inside a ActiveX control on a win32 application using "HWNDSource" mechanism. The RadScheduleView UI appears properly but we are facing problems with the modal dialogs like EditAppointmentDialog, EditRecurrenceDialog, DeleteConfirmationDialog etc.,

All these dialogs appears correctly on the RadScheduleView and blocks any operation on RadScheduleView as expected. But when we switch to other application and come back to ScheduleView application all these dialogs does not come to focus by default (ie., does not appear on RadScheduleView). These popped up dialogs remain behind and need to select manually (using Alt-tab) to bring them front.

Any help/idea to solve this issue is highly appreciated.

Regards,
Siva Prasad.Ch
Rosi
Telerik team
 answered on 28 Jul 2011
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Expander
Slider
TileList
DataPager
PersistenceFramework
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
NavigationView (Hamburger Menu)
Wizard
ExpressionEditor
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
LayoutControl
ProgressBar
Sparkline
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
Callout
PasswordBox
SplashScreen
Localization
Rating
Accessibility
CollectionNavigator
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
InlineAIAssistant
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?