Telerik Forums
UI for WPF Forum
4 answers
170 views
Hi

We are looking at using Telerik charts to replace an older WinForms charting widget, and we need to maintain backwards compatibility in order to maintain the correct look and feel.  Our previous charting widgets heavily supported 3D charting, but Telerik's 3D charts are not particularly similar in visual style to the ones we are looking to replace.  I have been looking at ChartArea, and have noticed that there is a Template3D that is used to dictate how the 3D charts are set up visually, and this would be perfect to use for what we want to do.  In attempting to create a custom style in order to specify our own Template3D, I have been running into a few problems.  Currently, I have a ChartArea style that specifies our custom Template3D, which I have pulled from looking at the default Template3D normally used:

<Style x:Key="defaultAreaStyle" TargetType="c:ChartArea">
        <Setter Property="Template3D">
            <Setter.Value>
                <ControlTemplate TargetType="c:ChartArea">
                    <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                        <ItemsPresenter/>
                        <Grid x:Name="PART_Container"/>
                        <c:ViewportPanel x:Name="PART_CameraExtensionCanvas">
                            <Viewport3D x:Name="PART_ViewPort3D">
                                <Viewport3D.Camera>
                                    <PerspectiveCamera LookDirection="0.2,-0.23,-1" Position="-40,37.5,195"/>
                                </Viewport3D.Camera>
                                <ModelVisual3D>
                                    <ModelVisual3D.Content>
                                        <Model3DGroup>
                                            <AmbientLight Color="#FF606060"/>
                                            <DirectionalLight Color="#FF989898" Direction="-0.5,-0.4,-1"/>
                                        </Model3DGroup>
                                    </ModelVisual3D.Content>
                                </ModelVisual3D>
                                <ContainerUIElement3D>
                                    <ContainerUIElement3D.Transform>
                                        <Transform3DGroup>
                                            <TranslateTransform3D OffsetX="-50" OffsetY="-37.5"/>
                                        </Transform3DGroup>
                                    </ContainerUIElement3D.Transform>
                                    <c:PlaneZX AdornerLayer="{x:Null}" Height="2" SecondaryTicksSource="{Binding AxisX.TickPoints, RelativeSource={RelativeSource TemplatedParent}}" SecondaryAxis3DPoints="0,0,10.1 100,0,10.1">
                                        <c:PlaneZX.PositionTransform>
                                            <TranslateTransform3D OffsetZ="0" OffsetX="0" OffsetY="-2"/>
                                        </c:PlaneZX.PositionTransform>
                                    </c:PlaneZX>
                                    <c:PlaneXY AdornerLayer="{x:Null}" Depth="2" PrimaryTicksSource="{Binding AxisX.TickPoints, RelativeSource={RelativeSource TemplatedParent}}" SecondaryTicksSource="{Binding AxisY.TickPoints, RelativeSource={RelativeSource TemplatedParent}}">
                                        <c:PlaneXY.PositionTransform>
                                            <TranslateTransform3D OffsetZ="-2" OffsetX="0" OffsetY="0"/>
                                        </c:PlaneXY.PositionTransform>
                                    </c:PlaneXY>
                                    <c:PlaneYZ AdornerLayer="{x:Null}" PrimaryTicksSource="{Binding AxisY.TickPoints, RelativeSource={RelativeSource TemplatedParent}}" PrimaryAxis3DPoints="0,0,10.1 0,75,10.1" Width="2">
                                        <c:PlaneYZ.PositionTransform>
                                            <TranslateTransform3D OffsetZ="0" OffsetX="-2" OffsetY="0"/>
                                        </c:PlaneYZ.PositionTransform>
                                    </c:PlaneYZ>
                                    <c:ItemsPresenter3D/>
                                </ContainerUIElement3D>
                            </Viewport3D>
                            <c:LabelsControl x:Name="PART_LabelsControl" ClipToBounds="True">
                                <c:LabelsControl.ItemsPanel>
                                    <ItemsPanelTemplate/>
                                </c:LabelsControl.ItemsPanel>
                                <c:LabelsControl.ItemTemplate>
                                    <DataTemplate>
                                        <c:LabelLayer>
                                            <c:LabelLayer.ItemsPanel>
                                                <ItemsPanelTemplate>
                                                    <c:LabelLayerItemsPanel IsItemsHost="True"/>
                                                </ItemsPanelTemplate>
                                            </c:LabelLayer.ItemsPanel>
                                            <c:LabelLayer.ItemTemplate>
                                                <DataTemplate>
                                                    <Border BorderBrush="#FF5C5C5C" BorderThickness="1" CornerRadius="3" LayoutTransform="{Binding Transform}">
                                                        <Border.Background>
                                                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                                <GradientStop Color="#FFCCCCCC" Offset="1"/>
                                                                <GradientStop Color="White"/>
                                                            </LinearGradientBrush>
                                                        </Border.Background>
                                                        <TextBlock Foreground="Black" FontWeight="Bold" HorizontalAlignment="Center" Margin="4,0">
                                                            <TextBlock.Text>
                                                                <Binding>
                                                                    <Binding.Converter>
                                                                        <c:LabelFormatConverter/>
                                                                    </Binding.Converter>
                                                                </Binding>
                                                            </TextBlock.Text>
                                                        </TextBlock>
                                                    </Border>
                                                </DataTemplate>
                                            </c:LabelLayer.ItemTemplate>
                                        </c:LabelLayer>
                                    </DataTemplate>
                                </c:LabelsControl.ItemTemplate>
                            </c:LabelsControl>
                        </c:ViewportPanel>
                        <c:NoDataControl x:Name="PART_NoData" Style="{TemplateBinding NoDataControlStyle}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

However, when I try to assign this style to the ChartArea of any 3D chart, I get a null reference exception in RadChart.  The call stack gives the last few calls as:
 
Telerik.Windows.Controls.Charting.dll!Telerik.Windows.Controls.Charting.Series3D.ChartArea.get()
Telerik.Windows.Controls.Charting.dll!Telerik.Windows.Controls.Charting.Series3D.LabelsControl.get()
Telerik.Windows.Controls.Charting.dll!Telerik.Windows.Controls.Charting.Series3D.RemoveLabelLayer()

So my question is how do I properly set Template3D (if it even possible)?  



Trystan
Top achievements
Rank 1
 answered on 22 Jul 2013
3 answers
240 views
When virtualizing is turned on, a group is collapsed when its out of visible area and expands if it needs to when it returned to the visible area.  I need to display a count of all expanded groups for the user.  How can I get the "actual" expand count from the RadGridView?  Since the RadGridView is auto-expanded when they come back, it obviously knows whatn needs to be expanded.
Dimitrina
Telerik team
 answered on 22 Jul 2013
1 answer
188 views
Is there any means of setting the QueryableEntityCollectionView to a subset of data using a linq query or some other means?

For example the following code will include all recurds in tbUser
New QueryableEntityCollectionView(Of DataModelEF.tbUser)(DbContext, "tbUsers")

I only want active users to be included based on a flag.  It's preferable if the user is blind to this filter in that the column on the grid doesn't show that it's been filtered.

I see that there is another constructer that uses ObjectQuery but I can't get my head around how this works and I can't seem to find any examples.

Any help is appreciated.

Rossen Hristov
Telerik team
 answered on 22 Jul 2013
3 answers
171 views
Hi Telerik,
 
 I have an mvvm solution. In my viewmodel I have an QueryableCollectionView of the class "BaseClass" objects and an standalone "BaseClass" element(let's call it seletedElem). The "BaseClass" class have a private QueryableCollection of the "ChildClass" objects(let's call it SCollection), and a property that returns this collection. Both classes are implementing the following interfaces:  INotifyPropertyChanged, IDataErrorInfo, IEditableObject. In my view I have raddatagrid which itemssource is binded to the ObservableCollection of "BaseClass" objects from viewmodel and selected item is binded to the standalone "BaseClass" object - selectedElem.

The Dataform is binded to the currently selected grid item in this way :

  ItemsSource="{Binding ElementName=xxx,Path=DataContext.seletedElem.SCollection}"

Then before the first DataGrid's selection changed event, or after the new item is inserted to the grid, when I press add button of the raddataform the current item of the SCollection is always an empty item of type ChildClass, but after the grid's selection changed event(when one of the existing items is selected) the current item of the SCollection is always null and im not able to edit it's properties.

Is there anyway to fix this behaviour?

Regards,
Tomasz
Maya
Telerik team
 answered on 22 Jul 2013
1 answer
79 views
Dear support,

We have the problem that in DayView some entries are out of the visible range.
Instead of scrolling down to see if there are items, we would like to have a mark that shows if there are items that are currently not shown.
Is this feature planned? Or is it possible to implement it by myself?

I have attached an image to clarify my request.

Regards
Rosi
Telerik team
 answered on 22 Jul 2013
1 answer
274 views
I have a series of square XY Scatter Charts which all range from +Value to -Value with 0 in the centre in both axis. (I have attached a picture of one of these charts to better illustrate what I mean). 

I need to be able to zoom in on all of these charts at once using a slider bar placed elsewhere on the form. I can easily tie the zoom level of the chart to the slider bar by using: 

chart.Zoom = new Size(zoomSlider.Value, zoomSlider.Value);

which zooms into both axis at the same rate. However by default this seems to zoom in to left most point on the X axis and the top most point on the Y. The behaviour I need is to zoom into the centre of each chart so that point 0, 0 is always at the centre (The two charts in the picture illustrate this. The Zoom/Pan bars are only there to illustrate what I mean and will not be there in the final product).

I'm fairly certain that I need to use PanOffset to achieve this but I am unsure how to calculate the point to pass to it. 

Any help would be appreciated. 

Thanks, 

Andy.



Rosko
Telerik team
 answered on 22 Jul 2013
3 answers
119 views
Hello,

I'm creating a custom ScatterLineSeries to simulate annotations in his own series. For this, I am register the load event of the series and look for the first canvas (serie.FindChildByType<Canvas>()) to add elements.
How do I calculate the coordinates corresponding to a DataPoint on canvas?

Thanks
Petar Marchev
Telerik team
 answered on 22 Jul 2013
1 answer
66 views
WWWWWWe
Yana
Telerik team
 answered on 22 Jul 2013
2 answers
328 views
hi,

i try to setup the cotrols that moving the of the toolbars within the toolbartray is possible (drag & drop ) but nothing work´s.
so how could i setup the control correctly that my users are able to configure there layout as they like ?

thanks regards


my xaml.

----------------------
<UserControl x:Class="xxxx.yyyy.Views.ContextTool"
			 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
			 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
			 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
			 xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
			 xmlns:regions="clr-namespace:Microsoft.Practices.Prism.Regions;assembly=Microsoft.Practices.Prism"
			 xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
			 xmlns:vm="clr-namespace:xxxx.yyyy.ViewModels"
			 mc:Ignorable="d" 
			 d:DesignHeight="100" d:DesignWidth="1280">
	<Grid x:Name="ContextToolRoot" HorizontalAlignment="Stretch">
		<telerik:RadToolBarTray IsManipulationEnabled="True">
			<telerik:RadToolBar Band="0" BandIndex="0" IsOverflowOpen="True" IsManipulationEnabled="True">
				<TextBlock Margin="0,0,9,0" Text="Open:" />
				<Button>
					<Image Source="Images/16/open.png" />
				</Button>
				<telerik:RadMenuItem Header="Item 1" Icon="Images/16/close.png" IsChecked="True"></telerik:RadMenuItem>
			</telerik:RadToolBar>
			<telerik:RadToolBar Band="0" BandIndex="1">
				<telerik:RadMenuItem Header="Item 1" Icon="Images/16/close.png" IsChecked="True"></telerik:RadMenuItem>
				<telerik:RadMenuItem Header="Item 2"></telerik:RadMenuItem>
				<telerik:RadMenuItem Header="Item 3"></telerik:RadMenuItem>
			</telerik:RadToolBar>
			<telerik:RadToolBar Band="1" BandIndex="0">
				<telerik:RadMenuItem Header="Item 1" Icon="Images/16/close.png" IsChecked="True"></telerik:RadMenuItem>
				<telerik:RadMenuItem Header="Item 2"></telerik:RadMenuItem>
				<telerik:RadMenuItem Header="Item 3"></telerik:RadMenuItem>
			</telerik:RadToolBar>
		</telerik:RadToolBarTray>
	</Grid>
</UserControl>
Petar Mladenov
Telerik team
 answered on 22 Jul 2013
1 answer
119 views
Hi ,
Since my project have to show the RSTP real-video, I change it to WPF application from silverlight. But very strange, the Map not work which is fine for silverlight, so I test the Hotel example of WPF, it also can not show the map. Could you provide me a single worked Hotel example solution for reference?

Thanks
Liu
Liu
Top achievements
Rank 1
 answered on 20 Jul 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
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?