Telerik Forums
UI for WPF Forum
7 answers
209 views
Hi,

I have a RadGridView as shown in the below code

 

<telerik:RadGridView Name="radGV_Library" AutoGenerateColumns="False"  ItemsSource="{Binding ListOfLibraryObjects}" ShowGroupPanel="False" SelectionChanged="radGV_Library_SelectionChanged" CanUserSortColumns="False" CanUserFreezeColumns="False" CanUserReorderColumns="False" CanUserResizeColumns="False">
    <telerik:RadGridView.Columns>
        <!--<telerik:GridViewSelectColumn/>-->
        <telerik:GridViewDataColumn Header="Name" DataMemberBinding="{Binding Name}" IsFilterable="False" >
        <telerik:GridViewDataColumn Header="Description" DataMemberBinding="{Binding Description}" IsFilterable="False"  IsReadOnly="True"/>
        <telerik:GridViewDataColumn Header="Is Master" DataMemberBinding="{Binding IsMaster}" IsFilterable="False"  IsReadOnly="True" />
        <telerik:GridViewDataColumn Header="Object ID" DataMemberBinding="{Binding ObjectID}" IsFilterable="False"  IsReadOnly="True"/>
    </telerik:RadGridView.Columns>
</telerik:RadGridView>

 

 
The GridView is in a user control and the data context is passed to the user control it as below
 

public void RefreshDataContext(VOC.Models.TheGameScreenM _theGSM) 
    this.DataContext = null; 
    this.DataContext = _theGSM; 
}

 
The GridView loads and refreshes with no problem. But I cannot edit the first column (the name column, which is string data). When the cell gets into edit mode, only the "space" and "back space" works. No other keys on the keyboard works to update the cell content. But however, the paste from right-click context menu works. So if I copy a text from somewhere and paste it in the cell, then that works.

I have tried
1. Mode = TwoWay
2. DataType = "{x:Type sys:String}"

nothing works!

Why is that?

Robin
Top achievements
Rank 1
 answered on 13 Jun 2016
5 answers
66 views

I have some Text as part of my Diagram Shapes but text values some times get rasterized and loose their clearances and their qualities.

 

Is there anyway to resolve this issue ?

Bruno
Top achievements
Rank 1
 answered on 13 Jun 2016
4 answers
880 views
I would like to have a toolbartray with multiple toolbars. In the last toolbar I would like to right align some of the buttons. I can align to the right if there is a single toolbar and no toolbartray but when I add the toolbartray the buttons are no longer aligned to the right. The toolbartray is contained in a grid. Thank you for your help.
Petar Mladenov
Telerik team
 answered on 13 Jun 2016
9 answers
801 views

I am just trying to apply a theme in a mvvm wpf caliburn.micro app. I added references for the necessary no-xaml wpf binaries (Telerik.Windows.Controls/Navigation, Telerik.Windows.Data (Binaries.NoXAML), in addition I added a reference to the required theme (Telerik.Windows.Themes.Green) and added the resources in a merged resource dictionary in my app.xaml.

I still can't get theming to work. Using implicit styled controls, I can't see any data displayed, but not using implicit styles everything is ok!

1) what am I missing?

2) And where should I apply e.g. : GreenPalette.LoadPreset(GreenPalette.ColorVariation.Dark) - in my bottstrapper?;

Thanks for your help.

Oliver

app.xaml

01.<Application x:Class="Notizen.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:Notizen">
02.    <Application.Resources>
03.        <ResourceDictionary>
04.            <ResourceDictionary.MergedDictionaries>
09.                <ResourceDictionary Source="/Telerik.Windows.Themes.Green;component/Themes/Telerik.Windows.Controls.xaml" />
10.                <ResourceDictionary Source="/Telerik.Windows.Themes.Green;component/Themes/Telerik.Windows.Controls.Navigation.xaml" />-->
11.                <ResourceDictionary Source="/Telerik.Windows.Themes.Green;component/Themes/System.Windows.xaml" />
12.                <ResourceDictionary Source="/Telerik.Windows.Themes.Green;component/Themes/Telerik.Windows.Controls.xaml" />
13.                <ResourceDictionary Source="/Telerik.Windows.Themes.Green;component/Themes/Telerik.Windows.Controls.Navigation.xaml" />
14.                <ResourceDictionary>
15.                    <local:AppBootstrapper x:Key="bootstrapper" />
16.                </ResourceDictionary>
17.            </ResourceDictionary.MergedDictionaries>
18.        </ResourceDictionary>
19.    </Application.Resources>
20.</Application>

 

appbootsrapper.cs

01.namespace Notizen {
02.    using System;
03.    using System.Collections.Generic;
04.    using Caliburn.Micro;
05.    using System.ComponentModel.Composition.Hosting;
06.    using System.Linq;
07.    using System.ComponentModel.Composition;
08.    using System.Windows;
09.    using Telerik.Windows.Controls;
10.    public class AppBootstrapper : BootstrapperBase {
11. 
12.        private CompositionContainer container;
13. 
14.        public AppBootstrapper()
15.        {
16.            Initialize();
17.        }
18. 
19.        protected override void Configure()
20.        {
21.            container = new CompositionContainer(
22.                new AggregateCatalog(AssemblySource.Instance.Select(x => new AssemblyCatalog(x)))
23.                );
24. 
25.            var batch = new CompositionBatch();
26. 
27.            batch.AddExportedValue<IWindowManager>(new WindowManager());
28.            //batch.AddExportedValue<IWindowManager>(new TelerikWindowManager());
29.            batch.AddExportedValue<IEventAggregator>(new EventAggregator());
30.            batch.AddExportedValue(container);
31. 
32.            // This is essential to enable Telerik's conventions
33.            TelerikExtensions.TelerikConventions.Install();
34. 
35.            GreenPalette.LoadPreset(GreenPalette.ColorVariation.Dark);
36.            //StyleManager.ApplicationTheme = ThemeManager.FromName("Expression_Dark");
37. 
38.            container.Compose(batch);
39.        }
40. 
41.        protected override object GetInstance(Type serviceType, string key)
42.        {
43.            string contract = string.IsNullOrEmpty(key) ? AttributedModelServices.GetContractName(serviceType) : key;
44.            var exports = container.GetExportedValues<object>(contract);
45. 
46.            if (exports.Any())
47.                return exports.First();
48. 
49.            throw new Exception(string.Format("Could not locate any instances of contract {0}.", contract));
50.        }
51. 
52.        protected override IEnumerable<object> GetAllInstances(Type serviceType)
53.        {
54.            return container.GetExportedValues<object>(AttributedModelServices.GetContractName(serviceType));
55.        }
56. 
57.        protected override void BuildUp(object instance)
58.        {
59.            container.SatisfyImportsOnce(instance);
60.        }
61. 
62.        protected override void OnStartup(object sender, StartupEventArgs e)
63.        {
64.            DisplayRootViewFor<IShell>();
65.        }
66. 
67.    }
68.}

tagsView.xaml

01.<UserControl x:Class="Notizen.Views.TagsView"
03.             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
04.             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
05.             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
06.             xmlns:local="clr-namespace:Notizen.Views"
07.             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
08.             xmlns:vm="clr-namespace:Notizen.ViewModels"
09.             mc:Ignorable="d"
10.             d:DesignHeight="300" d:DesignWidth="300">
11.    <UserControl.Resources>
12. 
13.            <Style x:Key="radTreeViewItemStyle" TargetType="{x:Type telerik:RadTreeViewItem}">
14.                <Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" />
15.                <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
16.                <Setter Property="FontWeight" Value="Normal" />
17.                <Style.Triggers>
18.                    <Trigger Property="IsSelected" Value="True">
19.                        <Setter Property="FontWeight" Value="Bold" />
20.                    </Trigger>
21.                </Style.Triggers>
22.            </Style>
23. 
24.        <HierarchicalDataTemplate x:Key="hierarchicalDataTemplate"
25.                          DataType="{x:Type vm:TagViewModel}"
26.                          ItemsSource="{Binding Tags}">
27.            <DockPanel LastChildFill="True">
28.                <StackPanel DockPanel.Dock="Right" Orientation="Horizontal" HorizontalAlignment="Right">
29.                    <TextBlock Text="{Binding Count}" Padding="0,0,5,0" Foreground="Gray" />
30.                </StackPanel>
31.                <StackPanel DockPanel.Dock="Left" Orientation="Horizontal">
32. 
33.                    <!--<Image Width="16" Height="16" Margin="3,0" Source="Images\RegionXX.png" />-->
34.                    <TextBlock Text="{Binding Name}" Foreground="#FF1E4BAC" />
35.                </StackPanel>
36. 
37.            </DockPanel>
38.        </HierarchicalDataTemplate>
39.    </UserControl.Resources>
40.    <DockPanel LastChildFill="True">
41.        <TextBlock DockPanel.Dock="Top" Background="CornflowerBlue" x:Name="Message" />
42.        <telerik:RadTreeView x:Name="Tags" DockPanel.Dock="Bottom"
43.                             ItemsSource="{Binding Path=Tags}"
44.                             ItemTemplate="{StaticResource hierarchicalDataTemplate}"
45.                             ItemContainerStyle="{StaticResource radTreeViewItemStyle}"
46.                             
47.                             >
48.            <!--<telerik:RadTreeViewItem Name="Item" Header="Root"></telerik:RadTreeViewItem>-->
49.            <!--Background="#FFE2E8F2"-->
50.            <!--ItemsSource="{Binding Path=Tags}"-->
51.            <!--<telerik:RadTreeView.Items>
52.                <telerik:RadTreeViewItem Name="Item" Header="Root"></telerik:RadTreeViewItem>
53.            </telerik:RadTreeView.Items>-->
54. 
55.        </telerik:RadTreeView>
56.    </DockPanel>
57.</UserControl>

 

tagsViewModel.cs

01.using Caliburn.Micro;
02.using System;
03.using System.Collections.Generic;
04.using System.Collections.ObjectModel;
05.using System.Linq;
06.using System.Text;
07.using System.Threading.Tasks;
08. 
09.namespace Notizen.ViewModels
10.{
11.    public class TagsViewModel : Screen
12.    {
13.        private TagViewModel tag;
14. 
15.        public string Message { get; set; }
16. 
17.        public TagsViewModel()
18.        {
19.            Tags = new ObservableCollection<TagViewModel>();
20.        }
21. 
22.        public TagViewModel RootTag
23.        {
24.            get
25.            {
26.                return this.tag;
27.            }
28. 
29.            set
30.            {
31.                this.tag = value;
32.                Tags.Add(value);
33.                NotifyOfPropertyChange(()=> Tags);
34.            }
35.        }
36. 
37.        public ObservableCollection<TagViewModel> Tags
38.        {
39.            get;
40.            set;
41.        }
42.    }
43.}

 

shellviewModel.cs

 

01.using System;
02.using Notizen.ViewModels;
03.using Notizen.Model;
04.using System.Linq;
05.using Caliburn.Micro;
06.using System.Collections.ObjectModel;
07.using System.ComponentModel.Composition;
08. 
09.namespace Notizen {
10.    [Export(typeof(IShell))]
11.    public class ShellViewModel : Caliburn.Micro.PropertyChangedBase, IShell {
12. 
13.        private TagViewModel _tags;
14.        public TagViewModel TagViewModel
15.        {
16.            get { return _tags; }
17.            set {
18.                if (_tags != value) return;
19.                _tags = value;
20.                NotifyOfPropertyChange(()=> TagViewModel);
21.            }
22.        }
23. 
24.        private string _helloText;
25. 
26.        public string HelloText
27.        {
28.            get { return _helloText; }
29.            set { _helloText = value; }
30.        }
31. 
32.        public TagsViewModel Tags { get; set; }
33. 
34. 
35.        public ShellViewModel()
36.        {
37.            LoadTags();
38.            HelloText = "Hello!";
39.             
40.        }
41. 
42.        private void LoadTags()
43.        {
44.            using (var context = new NotizenDbContext())
45.            {
46.                var roottag = context.Tags.Where(x => x.TagParentId == null).FirstOrDefault();
47. 
48.                //var tagViewModel = new TagViewModel(roottag, null);
49. 
50.                //TagViewModel = tagViewModel;
51. 
52.                Tags = new TagsViewModel() { Message = "Message from TestViewModel" , RootTag = tagViewModel  };
53.            }
54.        }
55.    }
56.}

 

Evgenia
Telerik team
 answered on 13 Jun 2016
7 answers
193 views

Hi. I have an strange behaviour, but I cannot tell when did it happen. I just have a project with a view containing a radgridview, using implicit styles, but the group header is not shown. Whenever I put another radgridview in the same view without any attribute set, also the header is not shown, but it is shown if I am using it in a view of a new project without implicit styles.

 

Did anyone got this problem and found a solution?

 

Thanks.

 

David.

David
Top achievements
Rank 1
 answered on 13 Jun 2016
1 answer
161 views

Can you please look into this issue

 

<Window x:Class="WpfApplication1.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
        Title="MainWindow" Height="350" Width="525">
    <Window.Resources>
        <Style x:Key="fieldStyle" TargetType="telerik:PropertyGridField" BasedOn="{StaticResource PropertyGridFieldStyle}">
            <Setter Property="Background" Value="Red"/>
        </Style>
    </Window.Resources>
    <Grid>
        <telerik:RadPropertyGrid x:Name="PropertyGrid1" FieldStyle="{StaticResource fieldStyle}"/>
    </Grid>
</Window>

 

Iam getting XAML Parse Exception when i tried to define style PropertyGridFieldStyle 

Dilyan Traykov
Telerik team
 answered on 13 Jun 2016
1 answer
106 views

Hello All,
    I have a need to implement the ItemCreated event over in the ViewModel for a RadCombobox.  I need an example of binding the event to a function.  Does anyone know of an example out there???  In my View I have a RadComboBox that is bound to a List<string> in my ViewModel.  In the contructor of the ViewModel, I populate this list.  I need to handle the case when the user adds a new value to this ComboBox.  I saw in the UI for Web docs a mention of the ItemCreated event.  I think this is what 'm looking for, but don't have a clue as to how to go about implementing it in the WPF MVVM code.  Any clues will be greatly appreciated!!!

Thanks in advance,

Kevin Orcutt
Senior Software Engineer

Wurth Electronics ICS, Inc.
7496 Webster St., Dayton, OH 45414
Tel: 937.415.7700 
Toll Free: 877.690.2207
Fax: 937.415.7710
Email: Kevin.Orcutt@we-ics.com
http://www.we-ics.com
 
 

 

Nasko
Telerik team
 answered on 13 Jun 2016
1 answer
166 views

Hi,

I tried some animations in my WPF application. I need to have a Zoom in animation like given as attached ppt(link) example...
Is this kind of animation possible with Telerik? Please provide help in any cases that how I can be able to achieve this effect. Thanks in advance..

https://onedrive.live.com/redir?resid=61BC36F4F01D37D4!270&authkey=!AIBY84p-LlBmzw0&ithint=file%2cpptx

 

Masha
Telerik team
 answered on 13 Jun 2016
1 answer
104 views
<telerik:RadComboBox
            Grid.Column="0"
            ItemsSource="{Binding Path=DropDownCollectionView}"
            IsSynchronizedWithCurrentItem="True"
            DisplayMemberPath="Code" IsEditable="True"
            EmptyText="Code"
            SelectedItem="{Binding Path=Container.Data, Mode=TwoWay}"
            Width="75" VerticalAlignment="Top">
    <i:Interaction.Behaviors>
        <wpf:RadComboBoxClearTextOnLostFocusWhenSelectedItemIsNull />
    </i:Interaction.Behaviors>
</telerik:RadComboBox>

 

For some reason after set Container.Data ComboBox Text has Object.ToString() value rather than the Object.Code property value however items of combobox dispay proper values.

public TData Data
{
    get { return _data; }
    set
    {
        if (_data == value) return;
        _data = value;
        RaisePropertyChanged();               
    }
}
 
public TContainer Container
{
    get { return _container; }
    private set
    {
        if (_container == value) return;
        _container = value;
        RaisePropertyChanged();
    }
}
Oleg Gochachko
Top achievements
Rank 1
 answered on 12 Jun 2016
4 answers
227 views

Hello,

I want to build a module with diagram,

in this module,I have two custom shape with textbox and button in the shape ContentTemplate.each shape provide 20 ToolboxItem,I want to achieve the goal when I input text to a textbox or click a button in the diagram,I want to get the text of the textbox or the which button was clicked.

the problem is:

1.in the diagram, there are 20 textbox/button ToolboxItem, how to binding a  Property to the textbox/button let me know each textbox's text and which button was clicked.

2.can we binding a DependencyProperty to the textbox or button, and the mode is twoway?

I have looked the Dashboard simple,but I have no idea about this requirement.

Here is the pivotal code:

GenericShapes.xaml:

<Style TargetType="dashboard:TextBoxShape">
        <Setter Property="Foreground" Value="Black" />
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="BorderBrush" Value="Transparent" />
        <Setter Property="Width" Value="120" />
        <Setter Property="Height" Value="40" />
        <Setter Property="MaxWidth" Value="400" />
        <Setter Property="ContentTemplate">
            <Setter.Value>
                <DataTemplate>
                    <telerik:RadWatermarkTextBox MinWidth="90" MaxWidth="400" LostFocus="ChangeValue"/>
                </DataTemplate>
            </Setter.Value>
        </Setter>
    </Style>

 

<Style TargetType="dashboard:ButtonShape">
        <Setter Property="Foreground" Value="Black" />
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="BorderBrush" Value="Transparent" />
        <Setter Property="Width" Value="120" />
        <Setter Property="Height" Value="40" />
        <Setter Property="MaxWidth" Value="400" />
        <Setter Property="ContentTemplate">
            <Setter.Value>
                <DataTemplate>
                    <Button></Button>
                </DataTemplate>
            </Setter.Value>
        </Setter>
</Style>

ToolboxControl.xaml:

<local:TextBoxToolboxItem Header="t1" />
<local:TextBoxToolboxItem Header="t2"  />
<local:ButtonToolboxItem Header="b1" />
<local:ButtonToolboxItem Header="b2" />

……

Wang
Top achievements
Rank 1
 answered on 11 Jun 2016
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
Slider
Expander
TileList
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
SyntaxEditor
MultiColumnComboBox
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
DesktopAlert
WatermarkTextBox
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
ProgressBar
Sparkline
LayoutControl
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
WebCam
CardView
DataBar
Licensing
FilePathPicker
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
HighlightTextBlock
Security
TouchManager
StepProgressBar
VirtualKeyboard
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?