Telerik Forums
UI for WPF Forum
1 answer
426 views

<telerik:GridViewDataColumn DataFormatString="N0" DataMemberBinding="{Binding MyValue}" Header="{Binding MyLabel, StringFormat=This {0}}" />

"This " is not shown in my header. What am I doing wrong?
Dimitrina
Telerik team
 answered on 08 May 2013
2 answers
193 views
Hi I am using the DataGrid with UI virtualization enabled.
In XAML the main attributes set on the Grid are:
EnableRowVirtualization="True"
ScrollMode="Deferred"
SelectionMode="Extended"

The grid binds to a VirtualQueryableCollection that makes uses of the ItemsLoading event to load data into the VirtualQueryableCollectionView.
So a queryable is not passed in as a constructor.

The Grid is working fine except for when I want to call Grid.SelectedItems.Clear().

I am manually populating the Grid.SelectedItems with the correct rows that should be selected.

The Grid has 240,000 rows. I select a few rows at the top to the grid.
Then I scroll down the bottom of the grid.
At the bottom I add another row to the selection, so Grid.SelectedItems has 3 items in it. Everything is fine.
A call is made to Grid.SelectedItems.Clear().
The process freezes and eventually a Stackoverflow exception is thrown.
The stacktrace does not show much. Throughout the trace a call to VirtualQueryableCollection.Load() is occurring for the whole list in increments of the LoadSize (100).

This is with version:
2013.1.022.0.40

If I try version
2012.3.1129.40
The process does not have a Stackoverflow exception but is stuck in a loop and does not return.

If I select items at the top of the grid only, it works fine. And if I select items at the bottom of the grid it works fine.

The machine I work on is not connected to the internet but I may be able to provide the stacktrace if needed.
Yordanka
Telerik team
 answered on 08 May 2013
1 answer
461 views
Hi all.

I need to sync position and width for two RadCartesianChart's.

XAML:

style definition for chart's:           
<Style x:Key="ChartStyle" TargetType="telerik:RadCartesianChart">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type telerik:RadChartBase}">
                            <Border Background="{TemplateBinding Background}"
                                    BorderBrush="{TemplateBinding BorderBrush}"
                                    BorderThickness="{TemplateBinding BorderThickness}">
                                <Grid>
                                    <ContentPresenter x:Name="emptyContent"
                                                      HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                      VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                                      Content="{TemplateBinding EmptyContent}"
                                                      ContentTemplate="{TemplateBinding EmptyContentTemplate}"
                                                      IsHitTestVisible="False"
                                                      Visibility="Collapsed" />
                                    <Canvas x:Name="adornerContainer"
                                            HorizontalAlignment="Stretch"
                                            VerticalAlignment="Stretch"
                                            Background="Transparent">
                                        <Canvas x:Name="labelContainer"
                                                HorizontalAlignment="Stretch"
                                                VerticalAlignment="Stretch">
                                            <Canvas x:Name="renderSurface"
                                                    HorizontalAlignment="Stretch"
                                                    VerticalAlignment="Stretch">
                                                <Border x:Name="plotAreaDecoration" Style="{TemplateBinding PlotAreaStyle}" />
                                            </Canvas>
                                        </Canvas>
                                    </Canvas>
                                </Grid>
                            </Border>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

chart #1:
<telerik:RadCartesianChart x:Name="DeviationChart"
                                               Grid.Row="1"
                                               HorizontalAlignment="Stretch"
                                               VerticalAlignment="Stretch"
                                               MaxZoom="{Binding MaxZoom}"
                                               MouseMove="Chart_OnMouseMove"
                                               PanOffset="{Binding PanOffset,
                                                                   Mode=TwoWay}"
                                               Style="{StaticResource ChartStyle}"
                                               Zoom="{Binding Zoom,
                                                              Mode=TwoWay}">
 
                        <telerik:ScatterAreaSeries x:Name="DeviationSeries"
                                                   Fill="{Binding DeviationFillColor}"
                                                   ItemsSource="{Binding DeviationPoints}"
                                                   Opacity="{Binding DeviationOpacity}"
                                                   Stroke="{Binding DeviationColor}"
                                                   StrokeMode="AllButPlotLine"
                                                   StrokeThickness="{Binding DeviationThickness}"
                                                   Tag="{Binding Path=Settings.PressureEU,
                                                                 Converter={StaticResource PressureEUConverter}}"
                                                   XValueBinding="X"
                                                   YValueBinding="Y">                           
                        </telerik:ScatterAreaSeries>
  <!-- ... -->
                        <telerik:RadCartesianChart.HorizontalAxis>
                            <telerik:LinearAxis x:Name="DeviationChartHorizontalAxis"
                                                MajorTickStyle="{StaticResource TopChartTickStyle}"
                                                Maximum="{Binding Path=ChartSettings.ChartMaxX}"
                                                Minimum="{Binding Path=ChartSettings.ChartMinX}"
                                                ShowLabels="False"
                                                Visibility="Collapsed" />
                        </telerik:RadCartesianChart.HorizontalAxis>
 
                        <telerik:RadCartesianChart.VerticalAxis>
                            <telerik:LinearAxis x:Name="DeviationChartVerticalAxis"
                                                Title="{Binding Path=PressureBaseEUText}"
                                                LabelFormat="N2"
                                                LastLabelVisibility="Visible"
                                                Maximum="{Binding DeviationChartSettings.ChartMaxY}"
                                                Minimum="{Binding DeviationChartSettings.ChartMinY}"
                                                Style="{StaticResource LinearAxisStyle}" />
                        </telerik:RadCartesianChart.VerticalAxis>
 
                        <telerik:RadCartesianChart.Grid>
                            <telerik:CartesianChartGrid MajorXLinesRenderMode="All"
                                                        MajorYLinesRenderMode="All"
                                                        StripLinesVisibility="None"
                                                        Style="{StaticResource CartesianChartGridStyle}" />
                        </telerik:RadCartesianChart.Grid>
 
                        <telerik:RadCartesianChart.Behaviors>
                            <telerik:ChartPanAndZoomBehavior PanMode="Both" ZoomMode="Both" />
                            <telerik:ChartTrackBallBehavior ShowIntersectionPoints="False"
                                                            ShowTrackInfo="True"
                                                            SnapMode="None" />
                        </telerik:RadCartesianChart.Behaviors>
 
                    </telerik:RadCartesianChart>


chart #2:
<telerik:RadCartesianChart x:Name="Chart"
                                           Grid.Row="1"
                                           MaxZoom="{Binding MaxZoom}"
                                           MouseMove="Chart_OnMouseMove"
                                           PanOffset="{Binding PanOffset,
                                                               Mode=TwoWay}"
                                           Style="{StaticResource ChartStyle}"
                                           Zoom="{Binding Zoom,
                                                          Mode=TwoWay}">
 
                    <telerik:ScatterAreaSeries x:Name="ElevationSeries"
                                               Fill="{Binding ElevationFillColor}"
                                               ItemsSource="{Binding RealElevationsPoints}"
                                               Opacity="{Binding ElevationOpacity}"
                                               Stroke="{Binding ElevationColor}"
                                               StrokeMode="AllButPlotLine"
                                               StrokeThickness="{Binding ElevationThickness}"
                                               XValueBinding="X"
                                               YValueBinding="Y">
                        <telerik:ScatterLineSeries.LegendSettings>
                            <telerik:SeriesLegendSettings Title="{Binding ElevationDescription}" />
                        </telerik:ScatterLineSeries.LegendSettings>
  <!-- ... -->
                        <telerik:ScatterLineSeries.TrackBallInfoTemplate>
                            <DataTemplate>
                                <Border Background="#FFEBEBEB">
                                    <TextBlock Text="{Binding Path=DataPoint.XValue, StringFormat=\{0:N3\}}" />
                                </Border>
                            </DataTemplate>
                        </telerik:ScatterLineSeries.TrackBallInfoTemplate>
                    </telerik:ScatterAreaSeries>
 
                    <telerik:RadCartesianChart.HorizontalAxis>
                        <telerik:LinearAxis x:Name="ChartHorizontalAxis"
                                            LabelFormat="N0"
                                            Maximum="{Binding Path=ChartSettings.ChartMaxX}"
                                            Minimum="{Binding Path=ChartSettings.ChartMinX}"
                                            Style="{StaticResource LinearAxisStyle}" />
                    </telerik:RadCartesianChart.HorizontalAxis>
 
                    <telerik:RadCartesianChart.VerticalAxis>
                        <telerik:LinearAxis x:Name="ChartVerticalAxis"
                                            HorizontalLocation="Left"
                                            LabelFormat="N2"
                                            Maximum="{Binding ChartSettings.ChartMaxY}"
                                            Minimum="{Binding ChartSettings.ChartMinY}"
                                            Style="{StaticResource LinearAxisStyle}" />
                    </telerik:RadCartesianChart.VerticalAxis>
 
                    <telerik:RadCartesianChart.Grid>
                        <telerik:CartesianChartGrid MajorXLinesRenderMode="All"
                                                    MajorYLinesRenderMode="All"
                                                    StripLinesVisibility="None"
                                                    Style="{StaticResource CartesianChartGridStyle}" />
                    </telerik:RadCartesianChart.Grid>
 
                    <telerik:RadCartesianChart.Behaviors>
                        <telerik:ChartPanAndZoomBehavior PanMode="Both" ZoomMode="Both" />
                        <telerik:ChartTrackBallBehavior ShowIntersectionPoints="False"
                                                        ShowTrackInfo="True"
                                                        SnapMode="None" />
                    </telerik:RadCartesianChart.Behaviors>
 
                </telerik:RadCartesianChart>

Code:
public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();
 
            if (!Chart.IsTemplateApplied) Chart.ApplyTemplate();
            if (!DeviationChart.IsTemplateApplied) DeviationChart.ApplyTemplate();
 
            var chartpad = Chart.Template.FindName("plotAreaDecoration", Chart) as Border;
            var deviationpad = DeviationChart.Template.FindName("plotAreaDecoration", DeviationChart) as Border;
 
            if (null != chartpad && null != deviationpad)
            {
                chartpad.SizeChanged += (sender, args) =>
                    {
                        // Set position of left edge of chart #1 relative to chart #2
                        object left = chartpad.GetValue(Canvas.LeftProperty);
                        deviationpad.SetValue(Canvas.LeftProperty, left);
                        // Set width of chart #1 relative to chart #2
                        object width = chartpad.GetValue(WidthProperty);
                        deviationpad.SetValue(WidthProperty, width);
                    };
            }
        }
But this doesn't work. Any ideas? Best regards, George.
Petar Marchev
Telerik team
 answered on 08 May 2013
1 answer
158 views
Hi 

I am working on the functionality having ChartView inside RadTileView. We are displaying a lot of charts in tiles.
The problem I am facing is when the Tile is restored, I want to remove all the legends and wants to show only chart. And again when the tile is maximized I want to display entire chart with legends.

I am attaching a image for better understaing.

Another problem is that when the chart is restored, the font size of Legends are not decreasing accordingly.

For RadTileViewItem: MinimizedHeight = 125, RestoredHeight=25. But when I restored the Tile, I am expecting the font size on chart to reduced by 80%.

Can you please help me in that.

I have created another but somehow it was not working
http://www.telerik.com/community/forums/wpf/charting-kit/chartview-legend-visibility.aspx
Ves
Telerik team
 answered on 08 May 2013
16 answers
1.1K+ views
Hallo,

I'm using the RadGridView for our business applications.
But our users are complaining that the data will not be loaded quickly.
So I've made ​​some comparative tests with a regular DataGrid and found out that the DataGrid binds data much faster than the RadGridView.

Loadingtime of 50000 Datarows with 8 Columns: 17 miliseconcs.
Binding to a DataGrid: 120 milliseconds. Used Memory: 7 MByte.
Binding to a RadGridView: 4 seconds. Used Memory: 51 MByte.

Are there any settings in RadGridView to get the same performance as a DataGrid?

I used following xaml for the RadGridView:

<telerik:RadGridView x:Name="RadGridView1" ShowGroupPanel="False" CanUserResizeColumns="False"  CanUserFreezeColumns="False" ItemsSource="{Binding Items, Source={StaticResource model}, Mode=OneWay}" IsReadOnly="True" AutoGenerateColumns="false"  DataLoadMode="Asynchronous" IsFilteringAllowed="False" >
           <telerik:RadGridView.Columns>
               <telerik:GridViewDataColumn DataMemberBinding="{Binding ID}" />
               <telerik:GridViewDataColumn DataMemberBinding="{Binding Col2}" />
               <telerik:GridViewDataColumn DataMemberBinding="{Binding Col3}" />
               <telerik:GridViewDataColumn DataMemberBinding="{Binding Col4}" />
               <telerik:GridViewDataColumn DataMemberBinding="{Binding Col5}" />
               <telerik:GridViewDataColumn DataMemberBinding="{Binding Col6}" />
               <telerik:GridViewDataColumn DataMemberBinding="{Binding Col7}" />
           </telerik:RadGridView.Columns>
       </telerik:RadGridView>

and following for the DataGrid:
<DataGrid ItemsSource="{Binding Items, Source={StaticResource model}}" RowHeight="25" CellStyle="{StaticResource Test}" />
Jc
Top achievements
Rank 1
 answered on 08 May 2013
1 answer
132 views
Hi,

i use the ContentTemplateSelector property of the RadTabControl. This way i can define different DataTemplates.

I created a property in my TabViewModel class called Content and based on its value I am selecting different DataTemplates. I also defined the different DataTemplates in the App.xaml file.

Now I want to change the Header of the TabItem out of the UserControl. And this is the problem, how do I solve this problem?

thanks
best regrads
rene
Petar Mladenov
Telerik team
 answered on 07 May 2013
8 answers
293 views
Hi,

is it possible to show/hide the GridLines via condition? So if condition is true, then show horizontal Gridline, if not, then hide it?
Want to make it, because Merging is not as possible as in older Application (take a look at attachment).

Or is there any other solution to show grid as attachment with WPF RadGridView?

Best regards,

David
Dimitrina
Telerik team
 answered on 07 May 2013
2 answers
195 views

I have managed to set up a PRISM region within the radRibbonView.RadRibbonTab which then has radRibbonGroup's loaded in from the modules containing the buttons for that module.  All good so far, however the modules donot load in the order which the radribbongroups need to appear in the tab.

I have tried using the radOrderedwrappanel in conjunction with the groupvariant priority as per snippit below to provide a solution with no luck.  Is there a way of doing this or will I have to look into custom loading order of the modules?

I ahve also added a custom regionAdaptor which seems to be working fine to allow the radribbongroups to be loaded into the orderedwrappanel.  However the ordering and sizing didnt work - it started wrapping after 3 ribbonGroups and it didnt order the groups correctly.

<telerik:RadRibbonGroup Header=" Order Search ">
                        <telerik:RadRibbonGroup.Variants>
                            <telerik:GroupVariant Priority="2" Variant="Large"/>
                        </telerik:RadRibbonGroup.Variants>
                        <telerik:RadOrderedWrapPanel>
                            <telerik:RadRibbonButton LargeImage="/Icons/48/Search.png" Size="Large" telerik:ScreenTip.Title="Order Search"/>
                        </telerik:RadOrderedWrapPanel>
                    </telerik:RadRibbonGroup>
Jonathan
Top achievements
Rank 1
 answered on 07 May 2013
1 answer
109 views
Hi,

I would like to know if it's possible to add new words to the existing spellchecker of Telerik?
Also, I would like to know if it possible to use an external spellchecker such a medical spellchecker with Telerik components?

Thank's
Petya
Telerik team
 answered on 07 May 2013
3 answers
276 views
Hi there

For the past day I'm trying to implement drag and drop behavior in the same gridview. I used the demo example to implement this. 
The events are fired when I click a row and drag, but the row isn't dropped.
When I debug the code, the DragDropPayloadManager.GetDataFromObject() method returns null in OnRowDragOver and  OnDrop  for the following lines:

--- OnRowDragOver
var details = DragDropPayloadManager.GetDataFromObject(e.Data, "DropDetails") as DropIndicationDetails;
 
--- OnDrop
var draggedItem = DragDropPayloadManager.GetDataFromObject(e.Data, "DraggedItem");
var details = DragDropPayloadManager.GetDataFromObject(e.Data, "DropDetails") as DropIndicationDetails;

Because of that, both events return nothing. 

Am I missing something?

Thanks in advance
Lowie

Lowie
Top achievements
Rank 1
 answered on 07 May 2013
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
VirtualKeyboard
HighlightTextBlock
Security
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?