Telerik Forums
UI for WPF Forum
2 answers
175 views

I'm trying to get a shapefile into the radmap (intending to be similar to the hotel floor plan example), however my shapefile does not get displayed properly. It's using WGS84, and is displayed correctly with every shapefile viewer i can find

Attached expected and resulting outputs

<Grid>
            <telerik:RadMap x:Name="radMap"
                        UseDefaultLayout="False"
                        UseSpringAnimations="False"
                        Background="Transparent"
                        MouseDragMode="None"
                        MouseDoubleClickMode="None">
                <telerik:RadMap.Provider>
                    <telerik:EmptyProvider/>
                </telerik:RadMap.Provider>


                <telerik:VisualizationLayer x:Name="VisualizationLayer">

                    <telerik:VisualizationLayer.Reader>
                        <telerik:AsyncShapeFileReader PreviewReadShapeDataCompleted="OnPreviewReadShapeDataCompleted">
                            <telerik:AsyncReaderSource  DataSource="C:\temp\TestImageBlend\Test.dbf" Source="C:\temp\TestImageBlend\Test.shp"  />
                        </telerik:AsyncShapeFileReader>
                    </telerik:VisualizationLayer.Reader>
                </telerik:VisualizationLayer>
            </telerik:RadMap>
        </Grid>

Jeremy
Top achievements
Rank 1
 answered on 12 Oct 2016
2 answers
298 views
If i setup a GanttView with some columns with a width of 100, then I'm unable to get the actual width of a column after the user resizes it; seems to always return the original '100' value. Is there some way of retrieving the updated width of these columns?
Paulo
Top achievements
Rank 1
 answered on 12 Oct 2016
3 answers
407 views

Hi, 

I'm using the RadPropertyGrid to show the properties of ExpandoObject with AutoGeneratePropertyDefinitions=true. The ExpandoObject has two nested properties. The first one is based on a public class with some public properties, the other is a second ExpandoObject. When I run the code the PropertyGrid shows the two nested properties as expected (i.e. they are collapsed).

When I expand the nested properties based on the class by clicking the expand-button (plus-sign in front of the nested propertie's name) the class' properties are shown as expected (see screenshot).

When I click the expand-button to expand the nested properties based on the second ExpandoObject the following exception is thrown:

    An unhandled exception of type 'System.InvalidOperationException' occurred in System.Core.dll

    Additional information: Property path is not valid. 'System.Dynamic.ExpandoObject+MetaExpando' does not have a public property named 'X'.

What can I do to solve this problem? I'm using the latest version "2016.3.194 (Dev)" of UI for WPF. Thank you for your help.

Best regards

Christian

 

P.S. The problem can be reproduced using the following XAML and code

 

<Window x:Class="TelerikWpfApp2.MainWindow"
                xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                xmlns:propertyGrid="clr-namespace:Telerik.Windows.Controls.Data.PropertyGrid;assembly=Telerik.Windows.Controls.Data"
                Title="RadPropertyGrid with nested properties based on ExpandoObject" Height="350" Width="508.828">
    <StackPanel>
        <telerik:RadPropertyGrid x:Name="MyPropertyGrid" NestedPropertiesVisibility="Visible" />
    </StackPanel>
</Window>

using System;
using System.Windows;
using System.Dynamic;
 
namespace TelerikWpfApp2
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            FillPropertyGrid();
        }
 
        private void FillPropertyGrid()
        {
 
            dynamic item = new ExpandoObject();
 
            dynamic nestedPropertyBasedOnExpando = new ExpandoObject();
            nestedPropertyBasedOnExpando.X = 1.0;
            nestedPropertyBasedOnExpando.Y = 2.0;
 
            item.NestedPropertyBasedOnClass = new Point(3.0, 4.0);
            item.NestedPropertyBasedOnExpando = nestedPropertyBasedOnExpando;
 
            // if the following propeties are added then no exception is thrown;
            // but nestedProperty1.X and item.X  are bound to each other!
            // item.X = 0.0;
            // item.Y = 0.0;
 
            MyPropertyGrid.Item = item;
             
        }
    }
}


Wolfgang
Top achievements
Rank 1
 answered on 12 Oct 2016
1 answer
228 views

Hi,

I need a functionality to allow users to add e a text that cannot be edited but can be deleted. It needs to have different style than ordinary text.

I Implemented it as.

        private void AddHeading(string key)
        {
            if (HeadingsProvider == null)
                return;
            RtbEditor.BeginUndoGroup();
            var box = RtbEditor.Document.GetLayoutBoxByPosition(RtbEditor.Document.CaretPosition.Location);
            var element = box.AssociatedDocumentElement;
            while (element is Inline && !(element is Span))
                element = element.Parent;
            while (element is Inline)
                element = element.Parent;
            var paragraph = element as Paragraph;
            if (paragraph?.IsEmpty == false)
                RtbEditor.InsertParagraph();
            var headings = HeadingsProvider.GetHeadings(key).ToList();
            for (int i = 0; i < headings.Count; i++)
            {
                RtbEditor.Document.Selection.Clear();
                var lStart = RtbEditor.Document.CaretPosition.Location;
                RtbEditor.InsertInline(new Span(" "));
                RtbEditor.ChangeStyleName("HeadingChar", false);
                RtbEditor.Insert(headings[i]);
                RtbEditor.InsertInline(new Span(" "));
                var lEnd = RtbEditor.Document.CaretPosition.Location;
                var start = new DocumentPosition(RtbEditor.Document);
                start.SetPosition(lStart);
                var end = new DocumentPosition(RtbEditor.Document);
                end.SetPosition(lEnd);
                RtbEditor.Document.Selection.AddSelectionStart(start);
                RtbEditor.Document.Selection.AddSelectionEnd(end);
                RtbEditor.InsertReadOnlyRange();
                RtbEditor.Document.Selection.Clear();
                if (i < headings.Count - 1)
                    RtbEditor.InsertParagraph();
            }
            RtbEditor.EndUndoGroup();
        }
        private void RemoveHeading()
        {
            var box = RtbEditor.Document.GetLayoutBoxByPosition(RtbEditor.Document.CaretPosition.Location);
            var span = box.AssociatedDocumentElement as Span;
            if (span == null)
                return;
            var sibling = span.PreviousSibling;
            while (sibling != null && !(sibling is ReadOnlyRangeStart) && !(sibling is ReadOnlyRangeEnd))
                sibling = sibling.PreviousSibling;
            var start = sibling as ReadOnlyRangeStart;
            if (start == null)
                return;
            var end = start.End;
            if (end == null)
                return;
            RtbEditor.Document.CaretPosition.MoveToInline(start);
            var lStart = RtbEditor.Document.CaretPosition.Location;
            RtbEditor.Document.CaretPosition.MoveToInline(end);
            var lEnd = RtbEditor.Document.CaretPosition.Location;
            var pStart = new DocumentPosition(RtbEditor.Document);
            pStart.SetPosition(lStart);
            var pEnd = new DocumentPosition(RtbEditor.Document);
            pEnd.SetPosition(lEnd);
            RtbEditor.BeginUndoGroup();
            RtbEditor.DeleteReadOnlyRange(start);
            RtbEditor.Document.Selection.Clear();
            RtbEditor.Document.Selection.AddSelectionStart(pStart);
            RtbEditor.Document.Selection.AddSelectionEnd(pEnd);
            RtbEditor.Delete(false);
            RtbEditor.EndUndoGroup();
        }

 

The insert part kind of work. I need to insert an empty span before and after so that the special style not propagate when you type after the heading. I tried to insert Span(""), but it crashes the editor... I can live with " ".

The problem is that remove heading does not work. While the ReadOnlyRange is removed, the text is not. It remains in the RTB and it is selected. you need to click on another paragraph and then you can delete it manually, but then you ending with editable heading if you won't delete it manually.

Mihail
Telerik team
 answered on 12 Oct 2016
1 answer
242 views

I have the code below.

sometime it doesn't show the controls inside

<telerik:RadBusyIndicator x:Name="ProgressIndicator">
     <telerik:RadBusyIndicator.BusyContent>
          <StackPanel>
               <TextBlock Name="ProgressStatus" HorizontalAlignment="Center" Grid.Row="0" />
               <telerik:RadButton Name="CancelButton" Content="Cancel" Click="CancelButton_Click" Margin="5" Grid.Row="1"/>
          </StackPanel>
     </telerik:RadBusyIndicator.BusyContent>
</telerik:RadBusyIndicator>

Attached below what it show when control is not showing

Nasko
Telerik team
 answered on 12 Oct 2016
2 answers
134 views

Hi,

in my app.cs I write this code, but format of datacolumn appears in "us"

<telerik:RadGridView.Columns>
  <telerik:GridViewDataColumn DataMemberBinding="{Binding CodiceModelloCommerciale}"
                              Header="Codice" IsReadOnly="True"/>
  <telerik:GridViewDataColumn DataMemberBinding="{Binding PrezzoUnitario}" Header="Prezzo"
                              HeaderTextAlignment="Right" TextAlignment="Right" DataFormatString="C"/>
</telerik:RadGridView.Columns>

public App()
{
this.InitializeComponent();
 
Thread.CurrentThread.CurrentCulture = new CultureInfo(name: "it-IT");
Thread.CurrentThread.CurrentUICulture = new CultureInfo(name: "it-IT");
[...]

Dario Concilio
Top achievements
Rank 2
 answered on 12 Oct 2016
1 answer
130 views

Hello, I need help about italian spell checking. 

First of all, download the zipped file from here:
http://download2.anastasis.it/software/fabrizio/TestTelerikSpellChecker.zip

it's a minimal WPF application using your current R3 2016 UI for WPF libraries, that reproduces the uncorrect behaviors. It has a custom minimal dictionary extracted from our 2 million words italian dictionary.

This mini-dictionary contains ALL the words written in the embedded test document.

---BEHAVIOR 1: Initial spellchecking

Starting up the application, only the first sentence seems completely correct.

Line 1: "Questa è una prova" is ok.

Line 2: "Dov'è" and "Quand'è" are marked wrong. "Cos'è? cos è!" are ok only because there's "cos" in the dictionary (cosine math function). We can't put "quand" and "dov" in the dictionary because they aren't correct single words in italian.

Line 3: "Prova dell'albero." is ok, but "nell'albero" and "sull'albero" are marked wrong.

Line 4a-b-c: Any order of the 3 elements results in "dell'albero" right and the others wrong. But they are all in the dictionary!

---BEHAVIOR 2: Suggestions word extraction

Problem 1:
Right-click with cursor on line 2, over the "o" in "Dov'è". First suggestion is "Dov'è", if you click it, the resulting word will be "Dov'è'è". So, it seems that the spellchecker treats the apostrophe ' character as delimiter, that's wrong in italian because "Dov" is wrong and only "Dov'[Vowel]*" is right. Same applies with thousands of different word that get truncated on the following one. 

Problem 2:
Now for the black magic: Undo with Ctrl-Z, select whole "Dov'è" word and right-click it: no suggestions supplied (correct). Then, click in the editor to dismiss the context menu and roll the mouse wheel. Refresh now shows as correct the entire selection that was previously marked wrong.
Plot twist: Put the cursor after "è" in "Dov'è" and press space: "Dov'è" is marked wrong again.

But in English, all the words like "isn't", "don't", "we're" etc are marked as correct. So what's the problem with italian spell checking?

I really hope to get help from you, because the spell checker is a paramount function for our application.

Thanks in advance.
Fabrizio

Todor
Telerik team
 answered on 12 Oct 2016
14 answers
318 views

Hello,

when the RibbonWindow is not maximized, left and right blocks are displayed on the outside of the window...

Milena
Telerik team
 answered on 12 Oct 2016
3 answers
131 views

Hello group, 

Question: I have a GridViewDataColumn. The Header property has been bind to an property in the ViewModel. If you now in the UI drag the column header to the group-by bar the Grid will display the name of the group-by as: [DataContextName].[PropertyName] instead of the (string) value of the property of the binding. 

I have tried to use an converter to collect the string form the resource file but this does not work either. 

Help would be appriciated. 

Richard

Stefan
Telerik team
 answered on 12 Oct 2016
2 answers
194 views

I created a test application with a treeview using implicit themes with the XAML files loaded into project. That works fine. If I move the treeview into a usercontrol in a separate project, it does not work. I tried both methods from here with no success:

https://blogs.msdn.microsoft.com/wpfsdk/2007/06/08/defining-and-using-shared-resources-in-a-custom-control-library/

It fails when loading Telerik.Windows.Controls.Navigation.xaml. It doesn't have a problem loading Telerik.Windows.Controls.xaml. The sample in the link

As a side note, I am doing the same thing with the map control and don't have any issues with it.

Link to the Project:
https://file.ac/1GnUz6lTPqM/

Here's the snippet from the UserControl:

<UserControl.Resources>
    <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
            <ResourceDictionary Source="Themes/System.Windows.xaml"/>
            <ResourceDictionary Source="Themes/Telerik.Windows.Controls.xaml"/>
            <ResourceDictionary Source="Themes/Telerik.Windows.Controls.Navigation.xaml"/>
        </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
</UserControl.Resources>

Jason D
Top achievements
Rank 1
Veteran
 answered on 11 Oct 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
Expander
Slider
TileList
PersistenceFramework
DataPager
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
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?