Telerik Forums
UI for WPF Forum
9 answers
90 views
Hi,
I have radbook which itemsource is ObservableCollection of objects of type BookPage (my object). I also have listbox with itemsource also connected with same ObservableCollection. What I try to accomplish is to use ListBox as Table of Content and to jump to particular page using it, and book pages should follow order of items in listBox. Everything works fine when I am adding or removing items in ListBox, but when I try to reorder items in listbox, sometimes one or two pages in book are lost, or to be absolutely precise, items in listbox are on correct places, pages are still in book, but I can not see them. (strange effect is showing: when I am flipping through book, that "lost" pages are "showing from nothing" and disapear to nothing  - pages are blank, I can not see any content on them. Can you suggest some solution to this problem, I suspect that something must be done with Collection, but can not figure  out what and how. Listbox always looks fine, 
Thanks in advance
Nebojsa Danilovic
Martin Ivanov
Telerik team
 answered on 22 Jan 2014
3 answers
777 views
Hello
I was looking through these forums, demos and google for any example of proper usage entity framework (for .NET 4 and .NET 4.5) with async data loading.

Lets look into requirements:
1. Database with 1 mln record (just to mention large amount of data)
2. EntityFramework (ObjectContext), with entity name "Product"
2. GridView on window.
3. DataPager assigned to GridView (100 per page)
4. BusyIndicator on window.

Requirement:
1. On window open - start asynchronous (to make UI responsible)  data loading with assigning IsBusy of BusyIndicator to true.
2. Once data loaded set IsBusy to false.
3. On page change, sort, filter - assign IsBusy to true when stared, and to false when ended.

So idea is quite simple for responsive UI. However I couldn't any example of such scenario.
The EnityFrameworkDataSource is totally synchronous and does not contain way to assign IsBusy and if there is delay UI stops responding.

Regards
Marcin
Yoan
Telerik team
 answered on 21 Jan 2014
2 answers
208 views
Hi everyone,

I am developing a WPF application in my company.
I use RadControls for WPF Q3 2013 trial version.

I use a RadDocking control in the main window.
PaneGroups's TabStripPlacement property is set to Dock.Top.
I have set up conditionnal docking to prevent a ToolWindow to contain more than one Pane.

2 close buttons are displayed for a floating Pane : 1 to close the ToolWindow and 1 to close the Pane which also closes the ToolWindow.
I want to hide the ToolWindow's close button circled in red on the attached picture 1.png.
I have read documentation about styling and theming the ToolWindow.
I think my goal can be achieved by creating a theme but I am not sure what I should do since I use the SummerTheme theme to set the StyleManager.ApplicationTheme property.

Can you please describe a way to achieve my goal ?
Thank you in advance for your help
Pascal GUERY
Top achievements
Rank 1
 answered on 21 Jan 2014
6 answers
185 views
Hello,

Is there a way to bind to IsReadOnly property of a PropertyGrid inside a CollectionEditor ?

The problem is, that I have a PropertyGrid that can edit collections. However, if I make it read-only (like this: IsReadOnly="{Binding Path=Simulation.HasResults}" ) then CollectionEditor is still editable.

Thanks!
Ivan
Top achievements
Rank 1
 answered on 21 Jan 2014
8 answers
255 views

I faced an unexpected RadPropertyGrid behavior, when I was trying to collapse an arbitrary group in PropertyGrid.

 

When my application starts RadPropertyGrid is loaded. I need some groups in RadPropertyGrid to be collapsed initially.

I'm trying to subscribe to Loaded event and make a call to propertyGrid.CollapseGroup(groupName); But it doesn't work.

Exploring forum I came across another solution

Dispatcher.BeginInvoke(DispatcherPriority.DataBind, new Action(() => CollapseGroup(GroupName)));

 

It works but with some quirks. Control loads groups (which I suppose to be collapsed) and they are initially expanded. And about a half of a second later they collapse. So the control blinks on the start and this looks very annoying.

How can I avoid this group "blinkings"?

 

A sample project can be found here: http://ge.tt/2gV7ilB1/v/0?c

Vera
Telerik team
 answered on 21 Jan 2014
2 answers
164 views
Hi,

I am using informationlayer and visualization layer to render my data. I am also using PolygonData to create my shapes. Here i want to hide my entire layer at certain zoom level. I have used below mentioned function but it is not working properly on entire layer. If i use it for a single label for example then it properly hide and show this label.

I am using this

MapLayer.SetZoomRange(myLayer, new ZoomRange(13, 18));

I am also not able to use this for my individual item which is PolygonData because of DepedencyObject.

Please let me know if i am getting something wrong or can anyone provide any alternate solution to show entire layer at certain zoomrange.

Thanks
Waqas Habib
Waqas
Top achievements
Rank 1
 answered on 21 Jan 2014
1 answer
64 views
Hi there,

In my WPF project I'm using two RESX files in order to keep both english and spanish languages, freely chosen for the user

When I assign my SQL view on ItemsSource I get twice the name of the headers (logically, I get each header from V_Clientes2 object and then get each header in Columns collection.. For example: Header="{Resx RadGridViewCustomers_Nombre}")



I do not know how can I fix that... it is not acceptable at all, 'cause the user see "Name" and "Nombre" at the same time instead to see just one of them:

XAML:

  <telerik:RadGridView x:Name="dgvClientes" ItemsSource="{Binding V_Clientes2}" HorizontalAlignment="Left"
            Margin="10,44,0,-45" VerticalAlignment="Top" Height="531"
            Width="469" ColumnWidth="SizeToCells" PreviewMouseDoubleClick="dgvClientes_PreviewMouseDoubleClick" Grid.ColumnSpan="2" Grid.RowSpan="3">

            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Tipo}" Header="{Resx RadGridViewCustomers_Tipo}" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Documento}" Header="{Resx RadGridViewCustomers_Doc}" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Nombre}" Header="{Resx RadGridViewCustomers_Nombre}" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Apellido1}" Header="{Resx  RadGridViewCustomers_PrimerApellido}" />

            </telerik:RadGridView.Columns>



Find attached one image where you can see this problem.

Thanks in advance for your time and advices,
Vera
Telerik team
 answered on 21 Jan 2014
1 answer
108 views
Picture of resized window is attached...

Application is opened in maximized mode.
I have RichTextBoxUI in TAB. On Button click tab with RichTextBox opens. 
If at some moment maximized window is resized and  then get back to maximized mode, every next button click, which opens tab, resizes main window to previous non-maximized size...

Win7 is my OS...
Missing User
 answered on 21 Jan 2014
5 answers
284 views

I'm creating a column chart with the x axis as a DateTimeContinuousAxis. Once the date range reaches sufficient length, the column widths do not get any smaller. Instead, they start overlapping each other. In my case, I have a about 85 points over a period of about 8 months with the axis MajorStepUnit set to Days.  You can see in the first attachment, a screenshot of the chart where the column backgrounds are blue and the borders are red.  My expectation is that the column width should shrink as more columns are added & that there should be no overlapping.  Any guidance here would be appreciated. Thanks - Mitch.


Below are the xaml and code behind for creating the attached screenshot (I can send the project if desired):



XAML:



<Window x:Class="MathNETTest.MainWindow"
        xmlns:local="clr-namespace:MathNETTest"
        Title="MainWindow" Height="750" Width="925" >
 
    <Window.Resources>
 
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/MathNETTest;component/Themes/Windows8/Telerik.Windows.Controls.xaml"/>
                <ResourceDictionary Source="pack://application:,,,/MathNETTest;component/Themes/Windows8/Telerik.Windows.Controls.DataVisualization.xaml"/>
                <ResourceDictionary Source="pack://application:,,,/MathNETTest;component/Themes/Windows8/Telerik.Windows.Controls.Chart.xaml"/>
            </ResourceDictionary.MergedDictionaries>
 
            <Style TargetType="{x:Type telerik:BarSeries}" BasedOn="{StaticResource BarSeriesStyle}">
                <Setter Property="PointTemplate">
                    <Setter.Value>
                        <DataTemplate>
                            <Border Background="Blue" BorderBrush="Red" BorderThickness="1">                               
                            </Border>
                        </DataTemplate>
                    </Setter.Value>
                </Setter>              
            </Style>
        </ResourceDictionary>
    </Window.Resources>
 
    <Grid>                     
        <telerik:RadCartesianChart x:Name="MyChart">
             
            <telerik:RadCartesianChart.HorizontalAxis>
                <telerik:DateTimeContinuousAxis LabelFitMode="Rotate"/>
 
            </telerik:RadCartesianChart.HorizontalAxis>
             
            <telerik:RadCartesianChart.VerticalAxis>
                <telerik:LinearAxis/>
            </telerik:RadCartesianChart.VerticalAxis>
 
            <telerik:RadCartesianChart.Grid>
                <telerik:CartesianChartGrid MajorLinesVisibility="XY">
 
                    <telerik:CartesianChartGrid.MajorXLineStyle>
                        <Style TargetType="Line">
                            <Setter Property="Stroke" Value="Black"/>                              
                        </Style>
                    </telerik:CartesianChartGrid.MajorXLineStyle>
 
                    <telerik:CartesianChartGrid.MajorYLineStyle>
                        <Style TargetType="Line">
                            <Setter Property="Stroke" Value="Black"/>                           
                        </Style>
                    </telerik:CartesianChartGrid.MajorYLineStyle>
 
                </telerik:CartesianChartGrid>
            </telerik:RadCartesianChart.Grid>
 
        </telerik:RadCartesianChart>
    </Grid>
</Window>




Code behind:



using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.ComponentModel;
using System.Numerics;
using Telerik.Windows.Controls.ChartView;
 
namespace MathNETTest
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public ObservableCollection<MySeries> Series { get; set; } 
        public ChartSeriesProvider SeriesProvider { get; set; }
 
        public MainWindow()
        {
            InitializeComponent();
            this.DataContext = this;
 
            ObservableCollection<MyPoint> points = new ObservableCollection<MyPoint>();
            MyPoint p = new MyPoint(new DateTime(2012, 9, 2), 4); points.Add(p);
            p = new MyPoint(new DateTime(2012, 9, 3), 6); points.Add(p);
            p = new MyPoint(new DateTime(2012, 9, 4), 4); points.Add(p);
            p = new MyPoint(new DateTime(2012, 9, 5), 3); points.Add(p);
            p = new MyPoint(new DateTime(2012, 9, 6), 1); points.Add(p);
            p = new MyPoint(new DateTime(2012, 9, 30), 3); points.Add(p);
            p = new MyPoint(new DateTime(2012, 10, 1), 1); points.Add(p);
            p = new MyPoint(new DateTime(2012, 10, 2), 2); points.Add(p);
            p = new MyPoint(new DateTime(2012, 10, 3), 3); points.Add(p);
            p = new MyPoint(new DateTime(2012, 10, 4), 1); points.Add(p);
            p = new MyPoint(new DateTime(2012, 10, 28), 4); points.Add(p);
            p = new MyPoint(new DateTime(2012, 10, 29), 2); points.Add(p);
            p = new MyPoint(new DateTime(2012, 11, 25), 2); points.Add(p);
            p = new MyPoint(new DateTime(2012, 12, 30), 5); points.Add(p);
            p = new MyPoint(new DateTime(2012, 12, 31), 1); points.Add(p);
            p = new MyPoint(new DateTime(2013, 1, 1), 2); points.Add(p);
            p = new MyPoint(new DateTime(2013, 1, 2), 3); points.Add(p);
            p = new MyPoint(new DateTime(2013, 1, 3), 1); points.Add(p);
            p = new MyPoint(new DateTime(2013, 1, 7), 2); points.Add(p);
            p = new MyPoint(new DateTime(2013, 1, 8), 2); points.Add(p);
            p = new MyPoint(new DateTime(2013, 1, 9), 3); points.Add(p);
            p = new MyPoint(new DateTime(2013, 1, 10), 2); points.Add(p);
            p = new MyPoint(new DateTime(2013, 1, 13), 3); points.Add(p);
            p = new MyPoint(new DateTime(2013, 1, 14), 14); points.Add(p);
            p = new MyPoint(new DateTime(2013, 1, 15), 6); points.Add(p);
            p = new MyPoint(new DateTime(2013, 1, 16), 9); points.Add(p);
            p = new MyPoint(new DateTime(2013, 1, 17), 5); points.Add(p);
            p = new MyPoint(new DateTime(2013, 1, 20), 4); points.Add(p);
            p = new MyPoint(new DateTime(2013, 1, 21), 6); points.Add(p);
            p = new MyPoint(new DateTime(2013, 1, 22), 6); points.Add(p);
            p = new MyPoint(new DateTime(2013, 1, 23), 8); points.Add(p);
            p = new MyPoint(new DateTime(2013, 1, 24), 4); points.Add(p);
            p = new MyPoint(new DateTime(2013, 1, 28), 4); points.Add(p);
            p = new MyPoint(new DateTime(2013, 1, 29), 20); points.Add(p);
            p = new MyPoint(new DateTime(2013, 1, 30), 17); points.Add(p);
            p = new MyPoint(new DateTime(2013, 1, 31), 4); points.Add(p);
            p = new MyPoint(new DateTime(2013, 2, 3), 2); points.Add(p);
            p = new MyPoint(new DateTime(2013, 2, 4), 15); points.Add(p);
            p = new MyPoint(new DateTime(2013, 2, 5), 7); points.Add(p);
            p = new MyPoint(new DateTime(2013, 2, 6), 10); points.Add(p);
            p = new MyPoint(new DateTime(2013, 2, 7), 10); points.Add(p);
            p = new MyPoint(new DateTime(2013, 2, 8), 1); points.Add(p);
            p = new MyPoint(new DateTime(2013, 2, 11), 6); points.Add(p);
            p = new MyPoint(new DateTime(2013, 2, 12), 6); points.Add(p);
            p = new MyPoint(new DateTime(2013, 2, 13), 9); points.Add(p);
            p = new MyPoint(new DateTime(2013, 2, 14), 6); points.Add(p);
            p = new MyPoint(new DateTime(2013, 2, 17), 4); points.Add(p);
            p = new MyPoint(new DateTime(2013, 2, 18), 9); points.Add(p);
            p = new MyPoint(new DateTime(2013, 2, 19), 5); points.Add(p);
            p = new MyPoint(new DateTime(2013, 2, 20), 4); points.Add(p);
            p = new MyPoint(new DateTime(2013, 2, 21), 4); points.Add(p);
            p = new MyPoint(new DateTime(2013, 2, 22), 1); points.Add(p);
            p = new MyPoint(new DateTime(2013, 2, 24), 1); points.Add(p);
            p = new MyPoint(new DateTime(2013, 2, 25), 11); points.Add(p);
            p = new MyPoint(new DateTime(2013, 2, 26), 7); points.Add(p);
            p = new MyPoint(new DateTime(2013, 2, 27), 8); points.Add(p);
            p = new MyPoint(new DateTime(2013, 2, 28), 8); points.Add(p);
            p = new MyPoint(new DateTime(2013, 3, 1), 6); points.Add(p);
            p = new MyPoint(new DateTime(2013, 3, 3), 1); points.Add(p);
            p = new MyPoint(new DateTime(2013, 3, 4), 13); points.Add(p);
            p = new MyPoint(new DateTime(2013, 3, 5), 11); points.Add(p);
            p = new MyPoint(new DateTime(2013, 3, 6), 10); points.Add(p);
            p = new MyPoint(new DateTime(2013, 3, 7), 11); points.Add(p);
            p = new MyPoint(new DateTime(2013, 3, 8), 5); points.Add(p);
            p = new MyPoint(new DateTime(2013, 3, 10), 1); points.Add(p);
            p = new MyPoint(new DateTime(2013, 3, 11), 2); points.Add(p);
            p = new MyPoint(new DateTime(2013, 3, 12), 4); points.Add(p);
            p = new MyPoint(new DateTime(2013, 3, 13), 6); points.Add(p);
            p = new MyPoint(new DateTime(2013, 3, 14), 4); points.Add(p);
            p = new MyPoint(new DateTime(2013, 3, 15), 11); points.Add(p);
            p = new MyPoint(new DateTime(2013, 3, 16), 10); points.Add(p);
            p = new MyPoint(new DateTime(2013, 3, 17), 8); points.Add(p);
            p = new MyPoint(new DateTime(2013, 3, 18), 5); points.Add(p);
            p = new MyPoint(new DateTime(2013, 3, 19), 4); points.Add(p);
            p = new MyPoint(new DateTime(2013, 3, 20), 7); points.Add(p);
            p = new MyPoint(new DateTime(2013, 3, 21), 3); points.Add(p);
            p = new MyPoint(new DateTime(2013, 3, 23), 1); points.Add(p);
            p = new MyPoint(new DateTime(2013, 3, 25), 4); points.Add(p);
            p = new MyPoint(new DateTime(2013, 3, 26), 2); points.Add(p);
            p = new MyPoint(new DateTime(2013, 3, 27), 1); points.Add(p);
            p = new MyPoint(new DateTime(2013, 3, 28), 1); points.Add(p);
            p = new MyPoint(new DateTime(2013, 4, 9), 2); points.Add(p);
            p = new MyPoint(new DateTime(2013, 4, 18), 1); points.Add(p);
            p = new MyPoint(new DateTime(2013, 5, 20), 1); points.Add(p);
 
            this.Series = new ObservableCollection<MySeries>();
            MySeries series = new MySeries();
            series.Points = points;
            this.Series.Add(series);
 
            this.SeriesProvider = new ChartSeriesProvider();
            this.SeriesProvider.Source = this.Series;
 
            CategoricalSeriesDescriptor sd = new CategoricalSeriesDescriptor();
            sd.CategoryPath = "X";
            sd.ValuePath = "Y";
            sd.ItemsSourcePath = "Points";
            sd.CollectionIndex = 0;
            sd.TypePath = "TelerikSeriesType";
 
            this.SeriesProvider.SeriesDescriptors.Add(sd);
 
            this.MyChart.SeriesProvider = this.SeriesProvider;
        }
    }
 
    public class MySeries
    {
        public MySeries()
        {
            this.TelerikSeriesType = typeof(BarSeries);
        }
        public SolidColorBrush Color { get; set; }
        public ObservableCollection<MyPoint> Points { get; set; }
 
        public Type TelerikSeriesType{get; set;}
    }
 
    public class MyPoint
    {
        public MyPoint(DateTime x, double y)
        {
            X = x;
            Y = y;
        }
 
        public DateTime X { get; set; }
        public double Y { get; set; }
    }
}




Yavor
Telerik team
 answered on 21 Jan 2014
5 answers
267 views
I have a user control that contains a RadDataForm and a button.

The button is bound to a custom command that has xxx_CanExecute() and xxx_Executed() methods defined.

I want xxx_CanExecute() to set e.CanExecute to false, if the form has any validation errors.  I'm getting the user control passed as sender, and from that I can get a reference to the RadDataForm.  But I can't for the life of me figure out how to tell if the form has any validation errors.  In the debugger I can see a validationErrors collection on the form, but that seems to be private. ValidateItem() always returns true, regardless.

Seems to me that I'm missing something simple.  Can someone point me in the right direction?
Vera
Telerik team
 answered on 21 Jan 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?