Telerik Forums
UI for WPF Forum
1 answer
643 views
Dear team,
we have a problem with RadGridView performance. He have the following scenario:
- We request data to server and it returns 44 rows into a list.
- We bind this list to a RadGridView with 8 columns. 
Some remarks:
- One column is a template column with a checkbox.
- We have a style for the gridview and gridview rows.
- We have auto with for these columns.

This process takes 1.615s. The 30% was spent by the server and the 70% by gridview. We don't know how to solve this problem. We have done the following tests:
- We have removed all styles and template column.
- Removing one column we gain a 6,8%.
- Removing 2 columns we gain a 16,1%, etc.
- Having only one column we gain 54,64%! It means that rendering speed depends on number of columns?
- Fixing columns width we can gain a 10%, 0,2s.
- Replacing this grid by a WPF grid we gain a 42%, 0,6s. This means that WPF standard grid is faster that RadGridView?

We hope you can help us.
Thank you in advance.
Stefan
Telerik team
 answered on 13 Oct 2016
5 answers
131 views
Hi,
How do I drag drop a group in the GridView to change Group's order?

Thank you.
Stefan Nenchev
Telerik team
 answered on 13 Oct 2016
1 answer
333 views

Looking for a way to dynamically populate multiple doughnut series so that I can make my "ring" chart that I made with the winforms version.

I've looked at the "Dynamic Number of Series (ChartSeriesProvider)" article. There doesn't seem to be a "PieSeriesDescriptor", and using the "ChartSeriesDescriptor" that is for "all series", it complains about "<telerik:ChartSeriesDescriptor " with the errors:

    The type "ChartSeriesDescriptor" is abstract and must include an explicit value

    Type 'ChartSeriesDescriptor' is not usable as an object element because it is not public or does not define a public parameterless constructor or a type converter.



Martin Ivanov
Telerik team
 answered on 13 Oct 2016
3 answers
167 views

Hello, lets say that we are using the radGridView and we have some columns like above:

First Name, Last Name, Sex, Age, Type1, Type2

The column "Type1" has a custom editor that implements the classes:

CreateCellElement and CreateCellEditElement using a combobox for selection of value.

Also i must clarify that column "Type2" depents on column's "Type1" value

So how can we clear in the current row the column's "Type2" value when the value of column "Type1" is changed through the CreateCellEditElement?

 

Thanks

Stefan Nenchev
Telerik team
 answered on 13 Oct 2016
1 answer
192 views

Once I build a RadDiagram I have basically one List of Items and one List of Links.

Now, would it be possible to Bind a TreeView with these two objects only?

 

See the screenshot attached for example. The Diagram consists of four objects linked together. 

Now, Is it possible to have a TreeView representation  of the Diagram like in the screenshot attached?

 

 

From the documentation seems to be that this cannot be done, unless I create dynamically a brand new List (i.e. TreeSource) for the tree from the Items and Links objects.

Where TreeSource would basically be a:

public ObservableCollection<TreeViewNode> TreeSource;

 

       public class TreeViewNode {
              public string DisplayName { get; set; }
              public ObservableCollection<TreeViewNode> Nodes { get; set; } 
                               }

 

And the XAML

 <HierarchicalDataTemplate x:Key="TreeViewTemplate" ItemsSource="{Binding Nodes}"    >
                <TextBlock Text="{Binding DisplayName}"/>
            </HierarchicalDataTemplate>
 
 <telerik:RadTreeView x:Name="tree"  ItemsSource="{Binding TreeSource}"> ItemTemplate="{StaticResource TreeViewTemplate}"

 

 

 

Martin Ivanov
Telerik team
 answered on 13 Oct 2016
6 answers
224 views

I am working on a Prism WPF project and I have a RadExpander in the shell of my project. 

 
    <Grid>
        <Grid>
            <ContentControl prism:RegionManager.RegionName="ContentRegion" />
            <tel:RadExpander x:Name="MenuFlyOut"
                             IsExpanded="True"
                             tel:AnimationManager.IsAnimationEnabled="True"
                             ExpandDirection="Right"
                             Width="210"
                             Background="CornflowerBlue"
                             Margin="0,0,159,0">
                <tel:RadExpander.Header>
                    <TextBlock x:Name="ExpanderCaption" Text="Menu" Foreground="White"/>
                </tel:RadExpander.Header>
                <tel:RadExpander.Content>
                    <StackPanel Margin="10,20,0,0" 
                                Width="200"
                                HorizontalAlignment="Left"
                                VerticalAlignment="Top"
                                Opacity="1">
                        //Button that opens UserControl in ContentRegion
                        //stuff in the stackpanel
                    </StackPanel>
                </tel:RadExpander.Content>
            </tel:RadExpander>
        </Grid>
    </Grid>

Currently since the RadExpander IsExpanded is set to "true" when the UserControl loads, the RadExpander is, obviously, still expanded. What I am trying to do is change the state of IsExpanded when the UserControl finishes loading. 

 

my latest attempt was to set it in the codebehind of the UserControl: 

public partial class UserControlContent : UserControl
{
    public UserControlContent()
    {
        InitializeComponent();
 
        var setExpander = new Shell();
        setExpander.MenuFlyOut.IsExpanded = false;
 
    }
}

But that didn't work.. I've tried a few other ways to do this.  Event Triggers, Binding to a property which calls a method that sets IsExpanded.

 

Obviously, I'm missing something, and help would be appreciated.

Martin Ivanov
Telerik team
 answered on 13 Oct 2016
2 answers
162 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
285 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
384 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
209 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
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
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
Licensing
WebCam
CardView
DataBar
FilePathPicker
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?