public static DataTemplate CreatePointTemplate( [NotNull]RoutedEventHandler pointLoadedHandler, string selectedBooleanField = null, string notSelectedBooleanField = null ) { var template = new DataTemplate(); var gridFactory = new FrameworkElementFactory(typeof(Grid)); gridFactory.AddHandler(Control.LoadedEvent, pointLoadedHandler); template.VisualTree = gridFactory; return template; }private void HandlePointCreated(object sender, RoutedEventArgs e) { var grid = (Grid)sender; var scatterDataPoint = (ScatterDataPoint)((FrameworkElement)sender).DataContext; var data = (HistoricalMarketDataPoint)scatterDataPoint.DataItem; var layoutSlot = scatterDataPoint.LayoutSlot; var bubble = new Ellipse(); var scale = !Equals(layoutSlot.Height, 0.0) ? data.PriceAverage/layoutSlot.Height : 1.0; var scaleSize = new Size(scale*layoutSlot.Width, scale*layoutSlot.Height); bubble.Width = scaleSize.Width; bubble.Height = scaleSize.Height; var chartPointBrush = new SolidColorBrush(Colors.Red); bubble.Fill = chartPointBrush; grid.Children.Add(bubble); }Hello,
For instance I have got 5 columns and I am going to show data (price) where each price(column) depends from different Currency.
I should get these currencies and prices from database and show them with correct cultures.
I don't know anything about currencies and prices, there could be anything. So I want to display price correctly for each currency.
I think that each column must have own culture, I should bind this cultures dynamically, and columns need to show prices correctly.
Is it possible?
Could you suggest me anything, best practices, working example, please?
Important: I don't want to have any code-behind and any static data in xaml. I implemented MVVM pattern.
Thank You
var colLabor = new GridViewComboBoxColumn();var tTemp = new DataTemplate() { DataType = typeof(Labor) };FrameworkElementFactory factoryTextBlock = new FrameworkElementFactory(typeof(TextBox)) { Name = "factoryTextBlock" };//factoryTextBlock.SetBinding(TextBlock.TextProperty, new Binding("ResourceTypeId"));factoryTextBlock.SetValue(TextBox.TextProperty, "OK BYE");factoryTextBlock.SetValue(TextBox.FontSizeProperty, 10.0d);factoryTextBlock.SetValue(TextBox.WidthProperty, 100.0d);tTemp.VisualTree = factoryTextBlock;colLabor.ToolTipTemplate = tTemp;Hi telerik support
I have a changing observable list of dates on my viewmodel, and I would like to highlight the days within that collection.
I have tried to implement my own DataTemplateSelector for the dayTemplateselector and I have managed to get the dates from my CollectionViewSource, but it seems that it only works on static data and the changes made to my collection does not appear in the Calendar.
How can I archive binding between the daytemplateSelector and my observableCollection?
<telerik:DataFormCheckBoxField Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="5" Label="FIRMA:" Foreground="Black" HorizontalAlignment="Left" x:Name="FirmaConf" VerticalContentAlignment="Center" VerticalAlignment="Center" DataMemberBinding="{Binding Firma,Mode=TwoWay}" /> <telerik:DataFormCheckBoxField Grid.Row="1" Grid.Column="0" Label="zeigen:" Foreground="Black" HorizontalAlignment="Left" x:Name="FirmazeigenConf" VerticalContentAlignment="Center" VerticalAlignment="Center" DataMemberBinding="{Binding FIRzeigen,Mode=TwoWay}"IsEnabled="{Binding ElementName=FirmaConf, Path=DataMemberBinding, Mode=TwoWay}"/>
<selector:CTS x:Key="CTS" DataTemplate1="{StaticResource SomeThing}" DateTemplate2="{StaticResource SomeThing2}"></selector:CTS><telerik:RadPane x:Name="FiltersPane" ContentTemplateSelector="{StaticResource CTS}" Content="{Binding Data, Mode=TwoWay}" ><DataTemplate x:Key="SomeThing"> <vw:aView DataContext="{Binding}"></vw:aView></DataTemplate><telerik:RadPane x:Name="FiltersPane" ContentTemplate="{StaticResource SomeThing}" Content="{Binding Data, Mode=TwoWay}">