Telerik Forums
UI for WPF Forum
1 answer
277 views
Hello Telerik Team,
i have a user control Project. I declared the theme files in MergedDictionaries to style the ganttcontrol.
The structure is designed as Mvvm. When i start the Application i get a Null reference exception.
How can i fix this issue? Thank you and regards Robert ...
 
<UserControl
    x:Class="GanttView.GanttControl"
    xmlns:vm="clr-namespace:GanttViewModel;assembly=GanttViewModel"
    DataContext="{DynamicResource GanttViewModel}"
    mc:Ignorable="d" d:DesignHeight="1024" d:DesignWidth="1280">
 
    <UserControl.Resources>
        <ResourceDictionary>
            <vm:GanttControlViewModel x:Key="GanttViewModel"/>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/GanttView;component/Themes/System.Windows.xaml"/>
                <ResourceDictionary Source="pack://application:,,,/GanttView;component/Themes/Telerik.Windows.Controls.xaml"/>
                <ResourceDictionary Source="pack://application:,,,/GanttView;component/Themes/Telerik.Windows.Controls.GanttView.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
Kalin
Telerik team
 answered on 26 Aug 2014
7 answers
476 views
Hi,

I wonder if Telerik WPF controls has a textbox that supports autocomplete as the user types in, similar to the Google search textbox (not a combo box). I have a repository of around 4000 items that I want bind as the data source for this autocomplete, and display a matching result as the user types (just top 7 or 8 of course). With Each new character typed, the suggested list get updated accordingly from those 4000 items.

Any suggestion how to achieve this behavior?

Regards
Kalin
Telerik team
 answered on 26 Aug 2014
3 answers
356 views
Hello,

We want to create an AutoComplete (or RadComboBox IsEditable=true) binded to a collection of 60.000 items so we would like that the control create the query in database (with like % for exemple) as to the user type the keyword and view the result in the choice popup of the combo

How to do this ?
Thx
Rosen Vladimirov
Telerik team
 answered on 26 Aug 2014
1 answer
688 views
Hello,

I'm working on a WPF application with ListViews and a pretty complex drag & drop functionality that I made.
I've replaced the ListViews with RadGridViews to achieve data virtualization.
I would like to use the existing drag and drop functionality with the RadGridView, can you please give me some info on how it can be done?

I've tried attaching the appropriate event handlers but it doesn't seem to work :
private void radGridView_Loaded(object sender, RoutedEventArgs e)
        {
            initInnerPlaylistControl(sender as RadGridView);
        }
 
public void initInnerPlaylistControl(RadGridView itemsControl)
        {
            itemsControl.AllowDrop = true;
            itemsControl.PreviewMouseLeftButtonDown += Rad_OnPreviewMouseLeftButtonDown;
            itemsControl.Drop += Rad_Drop;
            itemsControl.MouseMove += Rad_OnMouseMove;
            itemsControl.PreviewMouseLeftButtonUp += itemsControl1_OnPreviewMouseLeftButtonUp;
            itemsControl.QueryContinueDrag += Database_OnPreviewQueryContinueDrag;
            //itemsControl.OnGiveFeedback += OnGiveFeedback;
        }


thanks,
Idan
Dimitrina
Telerik team
 answered on 26 Aug 2014
3 answers
381 views
I have a column of Datetimes that have unique times for same dates. I want to not show the duplicates when filtering.
Based on this page http://www.telerik.com/help/wpf/gridview-filtering-faq-datetime-filtering.html all I need to do is write the following
 DataMemberBinding="{Binding BirthDate.Date}"

However all this does is remove the filter completely..

Any suggestions ?

thanks

Dimitrina
Telerik team
 answered on 26 Aug 2014
1 answer
125 views
Hello,

I am experiencing a problem with the Calendar when applying a custom style : when any style is applied on an instance of the RadCalendar, the Calendar UI is not correctly updating when switching from a month to another, and selected values become inconsistent.

This can be easilly reproduced by adding a RadCalendar such as : 

<telerik:RadCalendar HorizontalAlignment="Left" Height="299" Margin="10,10,0,0" VerticalAlignment="Top" Width="497" Style="{DynamicResource RadCalendarStyle1}"/>

, RadCalendarStyle1 beeing a copy of the unmodified original RadCalendar Template (created via Blend "Edit a Template" -> "Edit a Copy" menu).

I can provide the project files if needed.

Regards,
Masha
Telerik team
 answered on 26 Aug 2014
9 answers
248 views

I am trying to follow the instructions to create protected Telerik assemblies for deployment with my WPF application.

I see that in each control folder there is are two WPF solutions (among others)
*_WPF.sln
*_WPF_Work.sln

What is the _Work version  for?   I assume I should use the *_WPF.sln version?  
Was there some guidance in the documentation about that question that I overlooked?

However, when I build either version I get errors.  I already successfully built the Core\XCore_WPF.sln  solution.

Here is an example of an error I get when building the ImageEditor control: (either of the two WPF solutions)

Error 3 Unknown build error, 'The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) Line 837 Position 26.' D:\Dev\Telerik\Telerik_UI_for_WPF_Source_2014_1_0331\Controls\ImageEditor\ImageEditor\themes\GenericOfficeBlack.xaml 837 26
























































Robert
Top achievements
Rank 1
 answered on 22 Aug 2014
1 answer
141 views
Hello,

I am trying to customize my RadTileViewItem header using one of your ResourceDictionary, I downloaded from one of your examples in the forums. It worked nicely and I am able to change the color and effects in the header. 

                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">
     
    <SolidColorBrush x:Key="TileView_Background" Color="#FFFFFFFF"/>
    <!-- Resource dictionary entries should be defined here. -->
    <SolidColorBrush x:Key="TileView_OuterBorder" Color="#FF848484"/>
    <SolidColorBrush x:Key="TileView_InneBorder" Color="#FFFFFFFF"/>
    <Thickness x:Key="TileView_InneBorder_Thickness">1</Thickness>
    <SolidColorBrush x:Key="TileView_HeaderBorder" Color="#FFFFFFFF"/>
    <Thickness x:Key="TileView_HeaderBorder_Thickness">0 0 0 1</Thickness>
    <LinearGradientBrush x:Key="TileView_HeaderBackground" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#78C3B8"/>
        <GradientStop Color="#96C4BE" Offset="1"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="TileView_ButtonBackground" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#000000"/>
        <GradientStop Color="#000000" Offset="1"/>
    </LinearGradientBrush>
    <SolidColorBrush x:Key="TileView_ButtonOuterBorder" Color="White"/>
    <LinearGradientBrush x:Key="TileView_ButtonBackground_MouseOver" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#78C3B8" Offset="0"/>
        <GradientStop Color="#78C3B8" Offset="1"/>
        <GradientStop Color="#96C4BE" Offset="0.526"/>
        <GradientStop Color="#96C4BE" Offset="0.509"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="TileView_ButtonBackground_Pressed" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FFFECE95" Offset="0"/>
        <GradientStop Color="#FFFEB407" Offset="1"/>
        <GradientStop Color="#FFFEBB6E" Offset="0.517"/>
        <GradientStop Color="#FFE78318" Offset="0.539"/>
    </LinearGradientBrush>
    <CornerRadius x:Key="TileView_HeaderBorder_CornerRadius">2</CornerRadius>
    <SolidColorBrush x:Key="TileView_HeaderBorder_HorizontalSplitterBackground" Color="#47B5A3"/>
    <LinearGradientBrush x:Key="TileView_HeaderBorder_HorizontalSplitterOpacityMask" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="Black" Offset="0"/>
        <GradientStop Offset="1"/>
    </LinearGradientBrush>
    <SolidColorBrush x:Key="DisabledBrush" Color="#99FFFFFF"/>
    <CornerRadius x:Key="TileView_InneBorder_CornerRadius">8</CornerRadius>
    <CornerRadius x:Key="TileView_OuterBorder_CornerRadius">5</CornerRadius>
    <Style TargetType="telerik:RadTileViewItem">
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="Background" Value="{StaticResource TileView_Background}"/>
        <Setter Property="BorderBrush" Value="{StaticResource TileView_OuterBorder}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Padding" Value="7"/>
        <Setter Property="TileState" Value="Restored"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerik:RadTileViewItem">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Visibility" Storyboard.TargetName="DisabledVisual">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="MouseOver"/>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="{StaticResource TileView_OuterBorder_CornerRadius}" Margin="{TemplateBinding Padding}">
                            <Border BorderBrush="{StaticResource TileView_InneBorder}" BorderThickness="{StaticResource TileView_InneBorder_Thickness}" CornerRadius="{StaticResource TileView_InneBorder_CornerRadius}">
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="*"/>
                                    </Grid.RowDefinitions>
                                    <ContentPresenter x:Name="ContentElement" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Grid.Row="1" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                                    <Grid x:Name="ContentCacheHost" Grid.Row="1"/>
                                    <StackPanel>
                                        <Border BorderBrush="{StaticResource TileView_HeaderBorder}" BorderThickness="{StaticResource TileView_HeaderBorder_Thickness}" CornerRadius="{StaticResource TileView_HeaderBorder_CornerRadius}" Padding="10 0 7 0">
                                            <Border.Background>
                                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                    <GradientStop Color="#69AEA4"/>
                                                    <GradientStop Color="#96C4BE" Offset="1"/>
                                                </LinearGradientBrush>
                                            </Border.Background>
                                            <Grid MinHeight="28">
                                                <Border x:Name="GripBarElement" Background="Transparent">
                                                    <ContentPresenter x:Name="HeaderElement" ContentTemplate="{TemplateBinding HeaderTemplate}" HorizontalAlignment="Left" Margin="0,0,10,0" VerticalAlignment="Center"/>
                                                </Border>
                                                <ToggleButton x:Name="MaximizeToggleButton" HorizontalAlignment="Right" Height="17" VerticalAlignment="Center" Width="17">
                                                    <ToggleButton.Template>
                                                        <ControlTemplate TargetType="ToggleButton">
                                                            <Grid>
                                                                <VisualStateManager.VisualStateGroups>
                                                                    <VisualStateGroup x:Name="FocusStates">
                                                                        <VisualState x:Name="Focused"/>
                                                                        <VisualState x:Name="Unfocused"/>
                                                                    </VisualStateGroup>
                                                                    <VisualStateGroup x:Name="CommonStates">
                                                                        <VisualState x:Name="Disabled"/>
                                                                        <VisualState x:Name="Normal"/>
                                                                        <VisualState x:Name="MouseOver">
                                                                            <Storyboard>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="RestoreIcon">
                                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TileView_ButtonBackground_MouseOver}"/>
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="CollapseIcon">
                                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TileView_ButtonBackground_MouseOver}"/>
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                            </Storyboard>
                                                                        </VisualState>
                                                                        <VisualState x:Name="Pressed">
                                                                            <Storyboard>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="RestoreIcon">
                                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TileView_ButtonBackground_Pressed}"/>
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="CollapseIcon">
                                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TileView_ButtonBackground_Pressed}"/>
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                            </Storyboard>
                                                                        </VisualState>
                                                                    </VisualStateGroup>
                                                                    <VisualStateGroup x:Name="CheckStates">
                                                                        <VisualState x:Name="Checked">
                                                                            <Storyboard>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="Restore">
                                                                                    <DiscreteObjectKeyFrame KeyTime="0">
                                                                                        <DiscreteObjectKeyFrame.Value>
                                                                                            <Visibility>Collapsed</Visibility>
                                                                                        </DiscreteObjectKeyFrame.Value>
                                                                                    </DiscreteObjectKeyFrame>
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="Collapse">
                                                                                    <DiscreteObjectKeyFrame KeyTime="0">
                                                                                        <DiscreteObjectKeyFrame.Value>
                                                                                            <Visibility>Visible</Visibility>
                                                                                        </DiscreteObjectKeyFrame.Value>
                                                                                    </DiscreteObjectKeyFrame>
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                            </Storyboard>
                                                                        </VisualState>
                                                                        <VisualState x:Name="Unchecked">
                                                                            <Storyboard>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="Restore">
                                                                                    <DiscreteObjectKeyFrame KeyTime="0">
                                                                                        <DiscreteObjectKeyFrame.Value>
                                                                                            <Visibility>Visible</Visibility>
                                                                                        </DiscreteObjectKeyFrame.Value>
                                                                                    </DiscreteObjectKeyFrame>
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="Collapse">
                                                                                    <DiscreteObjectKeyFrame KeyTime="0">
                                                                                        <DiscreteObjectKeyFrame.Value>
                                                                                            <Visibility>Collapsed</Visibility>
                                                                                        </DiscreteObjectKeyFrame.Value>
                                                                                    </DiscreteObjectKeyFrame>
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                            </Storyboard>
                                                                        </VisualState>
                                                                        <VisualState x:Name="Indeterminate"/>
                                                                    </VisualStateGroup>
                                                                </VisualStateManager.VisualStateGroups>
                                                                <Grid x:Name="Restore" Background="Transparent" Height="13" Width="13">
                                                                    <ToolTipService.ToolTip>
                                                                        <ToolTip telerik:LocalizationManager.ResourceKey="TileViewItemMaximizeText"/>
                                                                    </ToolTipService.ToolTip>
                                                                    <Path x:Name="RestoreIcon" Data="M2,5 L2,8.9999999 6,8.9999999 6,5 z M0,3 L8,3 8,5 8,8.9999999 8,11 0,11 0,8.9999999 0,5 z M3,0 L11,0 11,2 11,8.9999999 9,8.9999999 9,2 3,2 z" Fill="{StaticResource TileView_ButtonBackground}" Margin="1" Stretch="Fill" Stroke="{x:Null}" StrokeThickness="0.5"/>
                                                                    <Path Data="M1,12 L9,12 9,13 1,13 z M3.9999999,7 L3.9999999,9 6,9 6,7 z M3,6 L7,6 7,7 7,9 7,10 3,10 3,9 3,7 z M0,4 L1,4 1,12 0,12 z M12,1 L13,1 13,10 12,10 z M3,1 L3.9999999,1 3.9999999,3 10,3 10,4 10,10 12,10 12,11 10,11 10,12 9,12 9,4 1,4 1,3 3,3 z M3.9999999,0 L12,0 12,1 3.9999999,1 z" Fill="{StaticResource TileView_ButtonOuterBorder}" Stretch="Fill" Stroke="{x:Null}" StrokeThickness="0.5"/>
                                                                </Grid>
                                                                <Grid x:Name="Collapse" Background="Transparent" Height="5" Visibility="Collapsed" Width="12">
                                                                    <ToolTipService.ToolTip>
                                                                        <ToolTip telerik:LocalizationManager.ResourceKey="TileViewItemMinimizeText"/>
                                                                    </ToolTipService.ToolTip>
                                                                    <Rectangle Fill="{StaticResource TileView_ButtonOuterBorder}" Stroke="{x:Null}" StrokeThickness="0.5"/>
                                                                    <Rectangle x:Name="CollapseIcon" Fill="{StaticResource TileView_ButtonBackground}" Margin="1" Stroke="{x:Null}" StrokeThickness="0.5"/>
                                                                </Grid>
                                                            </Grid>
                                                        </ControlTemplate>
                                                    </ToggleButton.Template>
                                                </ToggleButton>
                                            </Grid>
                                        </Border>
                                        <Border x:Name="Splitter" BorderThickness="0" Background="{StaticResource TileView_HeaderBorder_HorizontalSplitterBackground}" Height="4" OpacityMask="{StaticResource TileView_HeaderBorder_HorizontalSplitterOpacityMask}"/>
                                    </StackPanel>
                                    <Rectangle x:Name="DisabledVisual" Fill="{StaticResource DisabledBrush}" RadiusY="4" RadiusX="4" Grid.RowSpan="2" Visibility="Collapsed"/>
                                </Grid>
                            </Border>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>


But the issue is, on clicking the maximize button in header it does nothing except changing the icon to minimize. I was expecting it to actually maximize the item. I am guessing that I need to stick some code to make that happen but where to write that code is my confusion. 

Can you please suggest anything, 

Thanks,
Deepak

P.S: Apologies for sticking a long code but it doesn't allow me to attach a XAML/zip file. 
Evgenia
Telerik team
 answered on 22 Aug 2014
2 answers
88 views
I am having an issue when I have both IsVirtualizing and PreservePositionWhenMaximized set to true.

Here is the window code.
<Window x:Class="TileTest.MainWindow"
        Title="MainWindow" Height="350" Width="525"
        WindowStartupLocation="CenterScreen">
    <Window.Resources>
        <DataTemplate x:Key="ItemTemplate">
            <TextBlock Text="{Binding}" />
        </DataTemplate>
        <DataTemplate x:Key="ContentTemplate">
            <telerik:RadFluidContentControl>
                <telerik:RadFluidContentControl.SmallContent>
                    <TextBlock Text="small" />
                </telerik:RadFluidContentControl.SmallContent>
                <telerik:RadFluidContentControl.Content>
                    <TextBlock Text="default" />
                </telerik:RadFluidContentControl.Content>
                <telerik:RadFluidContentControl.LargeContent>
                    <TextBlock Text="large" />
                </telerik:RadFluidContentControl.LargeContent>
            </telerik:RadFluidContentControl>
        </DataTemplate>
    </Window.Resources>
    <Grid>
        <telerik:RadTileView x:Name="radTileView"
                             ContentTemplate="{StaticResource ContentTemplate}"
                             ItemTemplate="{StaticResource ItemTemplate}"
                              
                             MinimizedColumnWidth="200"
                             MinimizedRowHeight="200"
                              
                             PreservePositionWhenMaximized="True"
                              
                             IsVirtualizing="True"
                             />   
    </Grid>
</Window>


Here is the code behind.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
 
namespace TileTest
{
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
             
            var data = new List<string>();
            foreach (var num in Enumerable.Range(1, 12))
            {
                data.Add(String.Format("Item {0}", num));
            }
 
            this.radTileView.ItemsSource = data;       
        }
    }
}


This gives a view with 12 items.  If I double click the header of "item 1", it will maximize.  If I scroll down to "item 12"
 and double click it, it will maximize and the scroll possition will change slightly. If I scroll to the top of the small list, "item 1" is gone.  If I restore "item 12" (all items normal size), "item 1" reappears.

If I set either the IsVirtualizing or PreservePositionWhenMaximized to false, the items do not "disappear".  PreservePositionWhenMaximized needs to be true for our impementaion and disabling virualization is less than ideal.

Any ideas?

Ryan







​
Zarko
Telerik team
 answered on 22 Aug 2014
4 answers
447 views
I'm able to get items from a database into a combobox, but it's querying way too much data. Also, the selected item isn't displaying the string I expected. Instead, it's showing the object type as a string. I clearly don't understand something and I'm stuck even though I'm following this.

Database table name = CityCountyState, e.g.

City      County     State
--------- ---------  ---------
City1     County1    State1
City1     County2    State1
City2     County3    State2
City3     County4    State3


A city can be in more than one county, which is why I want to use a complex data template:

01.<DataTemplate x:Key="ComboBoxCustomTemplate">
02.  <Grid Margin="0,2,0,2">
03.    <Grid.ColumnDefinitions>
04.      <ColumnDefinition />
05.      <ColumnDefinition />
06.    </Grid.ColumnDefinitions>
07.    <Grid.RowDefinitions>
08.      <RowDefinition />
09.      <RowDefinition />
10.    </Grid.RowDefinitions>
11.    <TextBlock TextAlignment="Left" Grid.ColumnSpan="2" Text="{Binding City}" />
12.    <StackPanel Grid.Row="1" Grid.Column="0" Orientation="Horizontal">
13.      <TextBlock Text="County: " />
14.      <TextBlock Foreground="Blue" Text="{Binding County}" />
15.    </StackPanel>
16.    <StackPanel Grid.Row="1" Grid.Column="1" Orientation="Horizontal">
17.      <TextBlock Text="State: " />
18.      <TextBlock Foreground="Blue" Text="{Binding State}" />
19.    </StackPanel>
20.  </Grid>
21.</DataTemplate>


Combo box XAML:

1.<telerik:RadComboBox
2.    IsEditable="True"
3.    StaysOpenOnEdit="True"
4.    ItemsSource="{Binding Path=CitiesCountiesStates}"
5.    SelectedItem="{Binding Path=SelectedCityCountyState}"
6.    OpenDropDownOnFocus="True"
7.    IsFilteringEnabled="True"
8.    ItemTemplate="{StaticResource ComboBoxCustomTemplate}" />


Viewmodel:

01.public class AddEditViewModel : ViewModelBase<IDialogView>, IDisposable
02.{
03.  private readonly GeotechLogContext context;
04. 
05.  public ObservableCollection<CityCountyState> CitiesCountiesStates { get; set; }
06.  private string _SelectedCityCountyState;
07.  public string SelectedCityCountyState
08.  {
09.    get
10.    {
11.      return this._SelectedCityCountyState;
12.    }
13.    set
14.    {
15.      // This doesn't work, but it's what I want to do in concept.
16.      //  Value is always a string that equals the object type
17.      //
18.      //   CityCountyState x = (CityCountyState) value;
19.      //   this._SelectedCityCountyState = x.City + "," + x.County + "," + x.State;
20.      this._SelectedCityCountyState = value;
21.    }
22.  }
23. 
24.  public AddEditViewModel : base( new AddEditWindow() )
25.  {
26.    this.context = new GeotechLogContext();
27.    this.CitiesCountiesStates = new ObservableCollection<CityCountyState>
28.      (this.context.CityCountyStates.ToList<CityCountyState>() );
29.  }
30.}

The problem is obviously at line 27/28, but I don't know how to do it.
Rosen Vladimirov
Telerik team
 answered on 22 Aug 2014
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
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
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
PasswordBox
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?