Telerik Forums
UI for WPF Forum
1 answer
475 views
Hi,

I am working on a project where I need two things to be satisfied:
1. The chart has to be plotted for real-time data where each series on the chart must be smoothly plotted without any synchronization issue.
2. The Observablecollection that contains the list of series to be plotted (which is used to set as datacontext) has to be dynamic, i.e., it must be possible to add/remove the series dynamically.

I'm able to achieve the above features separately but not together, i.e., On adding a new Series dynamically, the chart doesn't show continuous data plot for all the series, even after using Task/Dispatcher. Any suggestion on how should I proceed on this?
Thank you in advance.
Petar Marchev
Telerik team
 answered on 05 Nov 2014
1 answer
452 views
Hello,

We are working on a WPF application. On some screens that seem very simple, load times are very long, even when there is no datas to bind.
I enclose you a basic example with a radGridView. This screen takes about 4 seconds to load on a PC windows 7 64, I5, 4GB RAM.

Can you enlighten us? We do something wrong? How can we improve the loading time?

Best regards.


in XAML :

<Window
x:Class="perfDG.CommandeRepartition"
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"
Title="CommandeRepartition"
Loaded="frmRepartition_Loaded"
WindowStartupLocation="CenterScreen"
MaxHeight="700"
x:Name="frmRepartition"
SizeToContent="WidthAndHeight">

<Grid>
   <Grid.RowDefinitions>
     <RowDefinition Height="35"></RowDefinition>
     <RowDefinition></RowDefinition>
     <RowDefinition Height="80"></RowDefinition>
   </Grid.RowDefinitions>

        
    <Grid Grid.Row="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"></ColumnDefinition>
<ColumnDefinition Width="Auto"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Foreground="White" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,10,0" Text="Regroupement"></TextBlock>
<ComboBox x:Name="cbbGroupement" Margin="2"
MinWidth="150"
Grid.Row="0" Grid.Column="1"
BorderBrush="Black" BorderThickness="1" Background="White"
ItemsSource="{Binding Path=LstItemGroupementRepartition}"
SelectedValuePath="Valeur"
DisplayMemberPath="Libelle"
SelectionChanged="cbbGroupement_SelectionChanged">
</ComboBox>
<Border Grid.Column="1" Margin="2" BorderThickness="1" BorderBrush="Black"></Border>
</Grid>

<!-- Grille -->

<!-- item source listRepartition is List<T>

        <telerik:RadGridView x:Name="dtaRepartition" Grid.Row="1" ItemsSource="{Binding listRepartition}" Margin="2,0,2,0"
AreRowDetailsFrozen="True"
AutoGenerateColumns="False"
CanUserDeleteRows="False"
CanUserFreezeColumns="False"
CanUserInsertRows="False"
CanUserReorderColumns="False"
CanUserResizeColumns="False"
CanUserResizeRows="False"
CanUserSortColumns="False"
CanUserSortGroups="False"
RowIndicatorVisibility="Collapsed"
ShowColumnHeaders="True"
GridLinesVisibility="Horizontal"
ShowGroupPanel="false"
CanUserSelect="False"
RowDetailsVisibilityMode="Collapsed"
EnableColumnVirtualization="False"
EnableRowVirtualization="False"
ShowGroupFooters="False"
ShowColumnFooters="True"
GroupRenderMode="Flat"
IsFilteringAllowed="False">

<telerik:RadGridView.Columns>

<telerik:GridViewDataColumn DataMemberBinding="{Binding libelleArticle}" Width="400"
UniqueName="libellearticle"
Header="Article" IsReadOnly="True" Focusable="False" Footer="Total"
ShowFieldFilters="False" ShowFilterButton="False" ShowDistinctFilters="False"
/>

<telerik:GridViewDataColumn DataMemberBinding="{Binding delai}" IsVisible="False"
Header="Delai" IsReadOnly="True" Focusable="False"
UniqueName="delai"
DataFormatString="{} {0:dd/MM/yyyy}"
ShowFieldFilters="False" ShowFilterButton="False" ShowDistinctFilters="False"
/>

<telerik:GridViewDataColumn DataMemberBinding="{Binding quantite}" Width="90"
UniqueName="quantite"
Header="Quantité" IsReadOnly="True" Focusable="False"
TextAlignment="Right"
ShowFieldFilters="False" ShowFilterButton="False" ShowDistinctFilters="False"
/>

<telerik:GridViewDataColumn DataMemberBinding="{Binding montant}" Width="120"
UniqueName="montant"
Header="Montant" IsReadOnly="True" Focusable="False"
TextAlignment="Right"
ShowFieldFilters="False" ShowFilterButton="False" ShowDistinctFilters="False"
/>

</telerik:RadGridView.Columns>
</telerik:RadGridView>


<!-- Boutons -->
<Grid Grid.Row="2">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<Button x:Name="btnRetour" Margin="10,5" Height="60" Width="80" Click="btnRetour_Click">
<StackPanel>
<TextBlock Text="Retour" ></TextBlock>
</StackPanel>
</Button>
</StackPanel>
</Grid>

</Grid>
</Window>

   
in CS :

// Loading data from a database
// form.datacontext = this




Dimitrina
Telerik team
 answered on 05 Nov 2014
3 answers
813 views
How can I make a RadGrid to always highlight the SelectedItem (or CurrentItem) in full color like in the screen-shot OK.png.

Why does the SelectedItem ist sometimes only have a border like in the other screen-shot (NotOK.png).

I want a behavior like in a ListBox where some item is always "active" (i.e. selected).
Maurizio
Top achievements
Rank 2
 answered on 04 Nov 2014
3 answers
145 views
Hi,

I want to use the TreeListView to display a hierarchical list of 2 or 3 differents types of object. I want to display different columnHearder according with row is selected. I don't want to use Gridviews with rowdetails. I want to have the columnHearders of each rowType in a same position.

How can I achieve this ?

Boris
Telerik team
 answered on 04 Nov 2014
10 answers
572 views
 
 I'm having problems loading an Arabic document into a RadRichTextBox -- the crux of the problem is that if you set the FlowDirection on the RadRichTextBox it puts the scroll bar on the left (where it should be) but it reverses the text. If one sets the FlowDirection to LeftToRight the text is correctly displayed (RTL and right aligned) but the scrollbar is on the right.

 Is this is a known problem or is the some way to load the control to make to correct this?

Thanks,
Scott

 Capture1.png shows a demo app that has a WebBrowser, RichTextBox and RadRichTextBox side by side, note that the text is the same in all controls, but the scrollbar is placed incorrectly on the RadRichTextBox (far right in the image).

 Capture2.png shows the same app with the FlowDirection set to RightToLife; obviously the text is reversed.

 Here's the guts of the code that loads the controls

public MainWindow()
{
    StyleManager.ApplicationTheme = new Windows8Theme();
 
    RadRichTextBox.DefaultTextRenderingMode =
        Telerik.Windows.Documents.UI.TextBlocks.TextBlockRenderingMode.TextBlockWithPropertyCaching;
 
    InitializeComponent();
 
    Loaded += (sender, args) =>
    {
        var htmlContent = File.ReadAllText(@"..\..\Arabic-Lipsum.html");
        MyWebBrowser.NavigateToString(htmlContent);
 
        var sourceConverter = new HtmlFormatProvider();
 
        var converted = sourceConverter.Import(htmlContent);
        MyRadRichTextBox.Document = converted;
 
        var rtf = new RtfFormatProvider();
        var rtfFromHtml = rtf.Export(converted);
 
        using (var ms = new MemoryStream(Encoding.UTF8.GetBytes(rtfFromHtml)))
        {
            MyRichTextBox.Selection.Load(ms, DataFormats.Rtf);
        }
    };
}

 And here's the XAML

<Window x:Class="RightToLeftLoadingProblem.MainWindow"
        Title="MainWindow"
        Width="1250"
        Height="750"
        ResizeMode="CanResizeWithGrip"
        WindowStartupLocation="CenterScreen">
    <Grid>
        <Grid Grid.Row="0" Margin="10">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <WebBrowser Name="MyWebBrowser"
                            Grid.Column="0"
                            Margin="5" />
                <RichTextBox Name="MyRichTextBox"
                             FlowDirection="RightToLeft"
                             Grid.Column="1"
                             Margin="5"
                             HorizontalScrollBarVisibility="Auto"
                             VerticalScrollBarVisibility="Auto" />
                <telerik:RadRichTextBox Name="MyRadRichTextBox"
                                        FlowDirection="RightToLeft"
                                        Grid.Column="2"
                                        Margin="5" />
            </Grid>
        </Grid>
    </Grid>
</Window>

 
Svetoslav
Telerik team
 answered on 04 Nov 2014
4 answers
248 views
I need a vertical scale to be displayed next to an image that have a moving png image. I've used a Telerik Vertical Gauge and a Linear Scale but my client doesn't want to see the gauge borders. How can I customize the gauge to remove the borders without making the scale disappear? Visibility and opactiy makes everything invisible so that's not going to work! Thank you. Here's my xaml and images of what I need and what I have! I appreciate your help!

                    <telerik:RadVerticalLinearGauge Grid.Row="2"
                                                    Visibility="Visible" 
                                                    Opacity=".65" 
                                                    Foreground="LightBlue" 
                                                    Background="LightBlue"  
                                                    Margin="15,0,162,0" 
                                                    BorderBrush="LightBlue"  
                                                    BorderThickness = "0,0,0,0">
                        <telerik:VerticalLinearScale Max="{Binding MastScaleMax.Value}" 
                                                     MajorTickRelativeWidth="5" 
                                                     ClipToBounds="True" 
                                                     FontWeight="ExtraBold"  
                                                     Min="-10"  
                                                     MajorTicks="{Binding MastScaleMax.Value,Converter={StaticResource MyIncrementCalculatorConverter}}" 
                                                     MinorTicks="5" 
                                                     BorderBrush="LightBlue" BorderThickness="0,0,0,0" Margin="18,-20,15,0" Height="644" VerticalAlignment="Top">
                            <telerik:Marker x:Name="TopDriveMarker" Opacity="0" telerik:ScaleObject.RelativeWidth="0.1*" 
                                            telerik:ScaleObject.RelativeHeight="0.05*" Width="5" Height="5" 
                                            Value="{Binding ElevatorPosition.Value}" 
                                            telerik:ScaleObject.Location="OverCenter" Margin="0,0,0,0">
                            </telerik:Marker>
                        </telerik:VerticalLinearScale>
                    </telerik:RadVerticalLinearGauge>



Richard
Top achievements
Rank 1
 answered on 04 Nov 2014
4 answers
207 views
Hi

I have the same problem as this person: StackOverflow question. If you have a RadGridView inside a TabControl, the grid view will lose its filtering and sorting options when you switch to another tab and back.

Details:
  • .NET 4.0
  • RadControls version:  2011.2.920.40
  • The grid views are bound to ObservableCollections or ICollectionViewSource. The filtering is only performed by clicking on the filter button on the column header. No filtering is performed in code.
  • Everything is implemented using the MVVM pattern.

Regards
Pierre-Andre


Adam
Top achievements
Rank 1
 answered on 04 Nov 2014
3 answers
240 views
When we use the auto-layout functionality in our application our diagram ends up upside down. The code we are using for adding shapes and connectors is below. Any ideas on how to make the layout start with our start block on top and then layout downward. I tried added the End block after the start and that did not fix it. Are there any other layouts we can try?

private void PopulateDiagram()
        {
            processingDiagram.Clear();
 
            RadDiagramShape ppEnd = new RadDiagramShape()
            {
                Content = "End",
                Width = 100,
                Height = 50,
                Geometry = ShapeFactory.GetShapeGeometry(CommonShapeType.CloudShape)
            };
            processingDiagram.AddShape(ppEnd);
 
            RadDiagramShape ppStart = new RadDiagramShape()
            {
                ContentTemplate = Resources["PreprocessingStartTemplate"] as DataTemplate,
                Width = 100,
                Height = 50,
                Geometry = ShapeFactory.GetShapeGeometry(CommonShapeType.CloudShape)
            };
            processingDiagram.AddShape(ppStart);
 
            foreach (PreprocessorSegment segment in SelectedEngine.PreprocessorSegments)
            {
                RadDiagramShape segmentStart = new RadDiagramShape()
                {
                    Content = segment.Node,
                    Width = 100,
                    Height = 50,
                    Geometry = ShapeFactory.GetShapeGeometry(CommonShapeType.EllipseShape)
                };
                processingDiagram.AddShape(segmentStart);
 
                RadDiagramConnection connection = new RadDiagramConnection()
                {
                    Source = ppStart,
                    SourceConnectorPosition = Telerik.Windows.Diagrams.Core.ConnectorPosition.Bottom,
                    Target = segmentStart,
                    TargetConnectorPosition = Telerik.Windows.Diagrams.Core.ConnectorPosition.Top,
                };
                processingDiagram.AddConnection(connection);
 
                List<string> unusedOutputs = new List<string>();
                Dictionary<string, RadDiagramShape> outputShapes = new Dictionary<string, RadDiagramShape>();
                Dictionary<PreprocessorAlgorithmInstance, RadDiagramShape> algShapes = new Dictionary<PreprocessorAlgorithmInstance, RadDiagramShape>();
                foreach (PreprocessorAlgorithmInstance alg in segment.Algorithms)
                {
                    RadDiagramShape algShape = new RadDiagramShape()
                    {
                        Content = alg,
                        ContentTemplate = Resources["PreprocessingAlgorithmInstanceTemplate"] as DataTemplate,
                        Width = 100,
                        Height = 50,
                        Geometry = ShapeFactory.GetShapeGeometry(CommonShapeType.RectangleShape)
                    };
 
                    unusedOutputs.Add(alg.Output);
                    outputShapes[alg.Output] = algShape;
                    algShapes[alg] = algShape;
                    processingDiagram.AddShape(algShape);
                }
 
                // Connections from Inputs to Outputs.
                foreach (PreprocessorAlgorithmInstance alg in segment.Algorithms)
                {
                    foreach (string input in alg.Inputs)
                    {
                        if (outputShapes.ContainsKey(input))
                        {
                            RadDiagramConnection cn = new RadDiagramConnection()
                            {
                                Content = input,
                                Source = outputShapes[input],
                                SourceConnectorPosition = Telerik.Windows.Diagrams.Core.ConnectorPosition.Bottom,
                                Target = algShapes[alg],
                                TargetConnectorPosition = Telerik.Windows.Diagrams.Core.ConnectorPosition.Top,
                                TargetCapType = Telerik.Windows.Diagrams.Core.CapType.Arrow1Filled
                            };
                            processingDiagram.AddConnection(cn);
                            unusedOutputs.Remove(input);
                        }
                        else
                        {
                            RadDiagramConnection cn = new RadDiagramConnection()
                            {
                                Content = input,
                                Source = segmentStart,
                                SourceConnectorPosition = Telerik.Windows.Diagrams.Core.ConnectorPosition.Bottom,
                                Target = algShapes[alg],
                                TargetConnectorPosition = Telerik.Windows.Diagrams.Core.ConnectorPosition.Top,
                                TargetCapType = Telerik.Windows.Diagrams.Core.CapType.Arrow1Filled
                            };
                            processingDiagram.AddConnection(cn);
                        }
                    }
                }
 
                foreach (string output in unusedOutputs)
                {
                    RadDiagramConnection cn = new RadDiagramConnection()
                    {
                        Content = output,
                        Source = outputShapes[output],
                        SourceConnectorPosition = Telerik.Windows.Diagrams.Core.ConnectorPosition.Bottom,
                        Target = ppEnd,
                        TargetConnectorPosition = Telerik.Windows.Diagrams.Core.ConnectorPosition.Top,
                        TargetCapType = Telerik.Windows.Diagrams.Core.CapType.Arrow1Filled
                    };
                    processingDiagram.AddConnection(cn);
                }
            }
 
            processingDiagram.Layout();
        }
Peshito
Telerik team
 answered on 04 Nov 2014
3 answers
128 views
Hi all,

I'm doing on RadGridView with a customized toggle button instead of using the default toggle button. I know it's coming with the ChildTableDefination and GridViewTableDefinition by default. So, since I'm using the customized toggle button, can I populate the child from my View Model once I clicked on the customized toggle button from parent? How could I link the toggle button once I clicked to the HierarchyChildTemplate? Thanks is advanced. Hope there's someone could help me.

Best Regards, 
Ng.
Dimitrina
Telerik team
 answered on 03 Nov 2014
2 answers
141 views
I am implementing a grid hierarchy view on my UI. I have used hierarchy child template for this and it has 3 levels layer A, layer B and layer C. Now when I click to expand layer A, it ends up expanding layer B as well.

Is there any way to stop this? I do not want to expand layer B by default. Please suggest few ideas.
Rohan
Top achievements
Rank 1
 answered on 03 Nov 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
NavigationView (Hamburger Menu)
Wizard
ExpressionEditor
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
Callout
PasswordBox
SplashScreen
Localization
Rating
Accessibility
CollectionNavigator
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?