Telerik Forums
UI for WPF Forum
1 answer
264 views

Hello. I'm sorry for being bothersome. I use telerik:ChartSeriesProvider for visualizing of variable number of Spline series. I want each curve (series) has its own color. I've written the following XAML markup for it:

<UserControl x:Class="DeviceReading.Views.AutomaticGainControlView"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             xmlns:prism="http://prismlibrary.com/"
             xmlns:local="clr-namespace:DeviceReading"
             prism:ViewModelLocator.AutoWireViewModel="True">
 
    <UserControl.Resources>
        <telerik:ChartPalette x:Key="customPalette">
            <telerik:ChartPalette.SeriesEntries>
                <telerik:PaletteEntryCollection SeriesFamily="Spline">
                    <telerik:PaletteEntry Fill="DarkBlue" Stroke="DarkBlue"/>
                    <telerik:PaletteEntry Fill="Purple" Stroke="Purple"/>
                    <telerik:PaletteEntry Fill="Red" Stroke="Red"/>
                    <telerik:PaletteEntry Fill="Green" Stroke="Green"/>
                    <telerik:PaletteEntry Fill="Cyan" Stroke="Cyan"/>
                    <telerik:PaletteEntry Fill="Sienna" Stroke="Sienna"/>
                    <telerik:PaletteEntry Fill="Magenta" Stroke="Magenta"/>
                    <telerik:PaletteEntry Fill="DodgerBlue" Stroke="DodgerBlue"/>
                </telerik:PaletteEntryCollection>
            </telerik:ChartPalette.SeriesEntries>
        </telerik:ChartPalette>
    </UserControl.Resources>
 
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
 
        <telerik:RadCartesianChart Visibility="{Binding IsAbsoluteSplineChartVisible}" Palette="{StaticResource customPalette}">
 
            <telerik:RadCartesianChart.HorizontalAxis>
                <telerik:DateTimeContinuousAxis MajorStepUnit="Second" LabelInterval="5" LabelFormat="hh:mm:ss" FontFamily="Segoe UI" PlotMode="OnTicks" TickOrigin="{Binding AlignmentDate}"/>
            </telerik:RadCartesianChart.HorizontalAxis>
 
            <telerik:RadCartesianChart.VerticalAxis>
                <telerik:LinearAxis FontFamily="Segoe UI" Title="Decibels [Db]" />
            </telerik:RadCartesianChart.VerticalAxis>
 
            <telerik:RadCartesianChart.Grid>
                <telerik:CartesianChartGrid MajorLinesVisibility="XY" MajorXLineDashArray="3,4" MajorYLineDashArray="3,4"/>
            </telerik:RadCartesianChart.Grid>
 
            <telerik:RadCartesianChart.SeriesProvider>
                <telerik:ChartSeriesProvider Source="{Binding SeriesData}">
                    <telerik:ChartSeriesProvider.SeriesDescriptors>
                        <telerik:CategoricalSeriesDescriptor CategoryPath="Category" ValuePath="Value" ItemsSourcePath="ChartPoints">
                            <telerik:CategoricalSeriesDescriptor.TypeConverter>
                                <local:SeriesTypeConverter/>
                            </telerik:CategoricalSeriesDescriptor.TypeConverter>
                        </telerik:CategoricalSeriesDescriptor>
                    </telerik:ChartSeriesProvider.SeriesDescriptors>
                </telerik:ChartSeriesProvider>
            </telerik:RadCartesianChart.SeriesProvider>
             
        </telerik:RadCartesianChart>
    </Grid>
</UserControl>

Just in case below is SeriesTypeConverter definition.

public class SeriesTypeConverter : IValueConverter
{  public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
 {
    SeriesModel seriesItem = value as SeriesModel;
 
    if (seriesItem.SeriesType == "Spline")
    {
       return typeof(SplineSeries);
    }
    else if (seriesItem.SeriesType == "Line")
    {
       return typeof(LineSeries);
    }
    else
    {
       return typeof(BarSeries);
    }
    }
 
  public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  {
    /*throw new NotImplementedException()*/return null;
     }

}

The number of series now is vary from 2 to 8 (but upper bound may be larger and will, say 16). As you can see from XAML, I've define my own color palette (customPalette). I bag your pardon, but I do not know how to use it in my XAML, to each curve (series) had its own different color. Now all displayed series (1, 2, 3, 4,...8) are dark blue (have  DarkBlue color which is the first in 'customPalette'). Please tell me, how do I do so that each curve had its own different color. And that this color does not change with each session of the program.

Dinko | Tech Support Engineer
Telerik team
 answered on 14 Sep 2016
1 answer
76 views

TreeView.CheckedItems  is contains is checked item.

But now  checkeditems is contains all item..

Dinko | Tech Support Engineer
Telerik team
 answered on 14 Sep 2016
2 answers
124 views

hi all,

i need to create a radribbonWindow with a ribbon view in it to use the ribbon title bar as the window title bar in .net4 but it errors that it must be .net4.5.

is there any way to use .net 4 to do that?

best regards.

Dinko | Tech Support Engineer
Telerik team
 answered on 14 Sep 2016
1 answer
116 views

hi

i need to add a move right and move left for backstage open and close  in ribbon in wpf.

how can i add it?

 

Dinko | Tech Support Engineer
Telerik team
 answered on 14 Sep 2016
7 answers
193 views

I have noticed keyboard navigation doesn't work as I was expecting and I wanted to see if the behavior is normal. You can see the same behavior I am seeing in the IsExpandedRowBinding example. The keyboard navigation works as expected for the first level of items but navigation of the child items does not work the same. Pressing left or right does not expand or collapse child items and pressing up or down does not change the selected child item.  

Do I need to handle the navigation of the child items myself or is there something I can do to get the TreeListView to handle it?

 

Thanks

Stefan Nenchev
Telerik team
 answered on 14 Sep 2016
1 answer
1.1K+ views

Hello. I am currently trying to accomplish a couple of things with checkbox columns in a RadGridView. My experience with styling in XAML is zero, so good examples would be helpful.

 

I would like to be able to take the standard checkbox control and 

1. Make it larger (for both view and edit mode)

2. When in view mode, style the checkbox control in some way to make it stand out (like Bold or a different color).

 

The documentation does not provide any examples at all on how to apply styles outside of telling you to create a ControlTemplate and then applying that ControlTemplate to a Style. I believe this is tailored to a developer that already knows how to do these things. 

I would like to apply this per-grid for the time being.

Dilyan Traykov
Telerik team
 answered on 14 Sep 2016
4 answers
187 views

We use the AutoGeneratingPropertyDefinition hook in a RadPropertyGrid to specify templates for the various properties we expose.  For a collection exposed in this property grid, CollectionEditor seems like a great model, but is there any sort of comparable mechanism to override or specify the property definitions that then appear in the CollectionEditor?  I don't see anything that looks immediately obvious in CollectionEditor or CollectionEditorPicker, and the CollectionEditor that ends up in our RadPropertyGrid doesn't seem to hit the property grid's AutoGeneratingPropertyDefinition event handler.

 

Elsewhere in these forums, I see suggestions to override the complete Template of CollectionEditor; is that the only option in this case?  Are there any better/easier methods to specify DataTemplates for properties in a CollecitonEditor?

 

Thanks,

 

-David

Stefan
Telerik team
 answered on 14 Sep 2016
2 answers
858 views

Hi,

I would create a UserControl called ListUserControl, it should contains RadgridView and other telerik controls. Ok.

But, what is the best way to wrap dependecy properties of GridView?

In primis: ItemSource, I created a dependency property in my user control, but how can I link this property to ItemSource of gridview, what is the best way to do this?

 

public partial class ListViewUserControl : UserControl
    {
        public ListViewUserControl()
        {
            InitializeComponent();
        }
 
        public object ItemSource
        {
            get { return (object) GetValue(ItemSourceProperty); }
            set { SetValue(ItemSourceProperty, value); }
        }
 
        // Using a DependencyProperty as the backing store for ItemSource.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty ItemSourceProperty =
            DependencyProperty.Register(name: "ItemSource", propertyType: typeof(object), ownerType: typeof(object), typeMetadata: new PropertyMetadata(0));
 
 
    }

Dario Concilio
Top achievements
Rank 2
 answered on 14 Sep 2016
2 answers
153 views
I have a DocumentViewer that is displaying XPS content, I also use Telerik's controls for showing a report content. What I am attempting to do is get my XPS and report to have the same look, and I have everything matching except the scroll bars.

I have the style defined of the report as follows

<Style TargetType="telerikReporting:ReportViewer">
  <Setter Property="Template">
    <Setter.Value>
      <ControlTemplate TargetType="telerikReporting:ReportViewer">
        <Grid x:Name="LayoutRoot">
          <Border BorderBrush="{StaticResource OuterControlBorderBrush}"
              BorderThickness="1"
              CornerRadius="6">
            <Border
              Margin="0"
              Padding="6"
              Background="{StaticResource ControlBackgroundBrush}"
              BorderBrush="{StaticResource InnerControlBorderBrush}"
              BorderThickness="1"
              CornerRadius="5">
              <Grid>
                <Grid.RowDefinitions>
                  <RowDefinition Height="auto" />
                  <RowDefinition Height="*" />
                  <RowDefinition Height="2" />
                  <RowDefinition Height="auto" />
                </Grid.RowDefinitions>
 
                <!-- Toolbar -->
                <telerik:RadToolBar Grid.Row="0"  >
                  <!-- Cut out to make the post shorter-->
                </telerik:RadToolBar>
 
                <Grid Grid.Row="1" >
                  <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                  </Grid.ColumnDefinitions>
 
                  <!-- Viewer Area -->
                  <Border Grid.Column="2"
                    CornerRadius="4"
                    BorderThickness="1"
                    BorderBrush="{StaticResource OuterViewerAreaBorderBrush}">
                    <Border BorderThickness="1"
                      Margin="0"
                      CornerRadius="3"
                      Background="{StaticResource InnerViewerAreaBackground}"
                      BorderBrush="{StaticResource InnerViewerAreaBorderBrush}">
                      <Grid>
                        <ScrollViewer x:Name="PageScrollViewer"
                          Visibility="Visible"
                          BorderThickness="0"
                          HorizontalScrollBarVisibility="Auto"
                          VerticalScrollBarVisibility="Visible">
                          <telerik:StyleManager.Theme>
                            <telerik:Office_SilverTheme/>
                          </telerik:StyleManager.Theme>
                          <ContentControl x:Name="PageContainer">
                            <ContentControl.Resources>
                              <ControlTemplate x:Key="PrintPreviewTemplate">
                                <Border x:Name="PageBorder"
                                  Background="{StaticResource PageBorderBackground}"
                                  BorderBrush="{StaticResource PageBorderBorderBrush}"
                                  BorderThickness="1"
                                  Margin="10"
                                  VerticalAlignment="Center"
                                  HorizontalAlignment="Center">
                                  <telerik:LayoutTransformControl
                                x:Name="PageContainer"
                                LayoutTransform="{Binding PageTransform}"
                                Content="{Binding PageRoot}" />
                                </Border>
                              </ControlTemplate>
                              <ControlTemplate x:Key="InteractiveTemplate">
                                <ContentPresenter Margin="10"
                                        HorizontalAlignment="Left"
                                        VerticalAlignment="Top">
                                  <ContentPresenter.Content>
                                    <telerik:LayoutTransformControl
                                    x:Name="PageContainer"
                                    LayoutTransform="{Binding PageTransform}"
                                    Content="{Binding PageRoot}" />
                                  </ContentPresenter.Content>
                                </ContentPresenter>
                              </ControlTemplate>
                            </ContentControl.Resources>
                          </ContentControl>
                        </ScrollViewer>
 
                        <!-- Progress -->
                        <telerikReporting:DialogBox x:Name="ViewerProgressMessage">
                          <!-- Cut out to make the post shorter-->
                        </telerikReporting:DialogBox>
 
                        <!-- Error message -->
                        <TextBox x:Name="ViewerError">
                            <!-- Cut out to make the post shorter-->
                        </TextBox>
 
                        <!-- Export dialog -->
                        <telerikReporting:DialogBox x:Name="ExportDialog">
                          <!-- Cut out to make the post shorter-->
                        </telerikReporting:DialogBox>
                      </Grid>
                    </Border>
                  </Border>
                </Grid>
 
                <!-- Status Area -->
                <Grid  Grid.Row="4">
                  <!-- Cut out to make the post shorter-->
                </Grid>
              </Grid>
            </Border>
          </Border>
        </Grid>
      </ControlTemplate>
    </Setter.Value>
  </Setter>
</Style>


I extrated the style of the DocumentViewer using Blend and attempted to override the ScrollViewer's style to use the same theme

<!-- Office_SilverTheme -->
<SolidColorBrush x:Key="OuterControlBorderBrush" Color="#3FFFFFFF" />
<SolidColorBrush x:Key="InnerControlBorderBrush" Color="#FF7E7E95" />
<LinearGradientBrush x:Key="ControlBackgroundBrush" EndPoint="0.5,1" StartPoint="0.5,0">
  <GradientStop Color="#FFF0F0F9"/>
  <GradientStop Color="#FF9F9FBB" Offset="0.1"/>
  <GradientStop Color="#FFE1E1EA" Offset="1"/>
</LinearGradientBrush>
 
<SolidColorBrush x:Key="OuterViewerAreaBorderBrush" Color="#66FFFFFF" />
<SolidColorBrush x:Key="InnerViewerAreaBorderBrush" Color="#FF7E7E95" />
<SolidColorBrush x:Key="InnerViewerAreaBackground" Color="White" />
<SolidColorBrush x:Key="ForegroundBrush" Color="Black" />
<SolidColorBrush x:Key="PageBorderBackground" Color="White" />
<SolidColorBrush x:Key="PageBorderBorderBrush" Color="DarkGray" />
<SolidColorBrush x:Key="ErrorMessageForeground" Color="Gray" />
<!-- Office_SilverTheme -->
 
<Style x:Key="TelerikDocumentStyle" BasedOn="{x:Null}" TargetType="{x:Type DocumentViewer}">
  <Setter Property="Template">
    <Setter.Value>
      <ControlTemplate TargetType="{x:Type DocumentViewer}">
        <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Focusable="False">
          <Grid Background="{TemplateBinding Background}" KeyboardNavigation.TabNavigation="Local">
            <Grid.ColumnDefinitions>
              <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
              <RowDefinition Height="Auto"/>
              <RowDefinition Height="*"/>
              <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <ContentControl Grid.Column="0" Focusable="{TemplateBinding Focusable}" Grid.Row="0" Style="{DynamicResource {ComponentResourceKey ResourceId=PUIDocumentViewerToolBarStyleKey, TypeInTargetAssembly={x:Type Documents:PresentationUIStyleResources}}}" TabIndex="0"/>
            <ScrollViewer x:Name="PART_ContentHost" CanContentScroll="true" Grid.Column="0" Focusable="{TemplateBinding Focusable}" HorizontalScrollBarVisibility="Auto" IsTabStop="true" Grid.Row="1" TabIndex="1">
              <telerik:StyleManager.Theme>
                <telerik:Office_SilverTheme/>
              </telerik:StyleManager.Theme>
            </ScrollViewer>
            <DockPanel Grid.Row="1">
              <FrameworkElement DockPanel.Dock="Right" Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}"/>
              <Rectangle Height="10" Visibility="Visible" VerticalAlignment="top">
                <Rectangle.Fill>
                  <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                    <LinearGradientBrush.GradientStops>
                      <GradientStopCollection>
                        <GradientStop Color="#66000000" Offset="0"/>
                        <GradientStop Color="Transparent" Offset="1"/>
                      </GradientStopCollection>
                    </LinearGradientBrush.GradientStops>
                  </LinearGradientBrush>
                </Rectangle.Fill>
              </Rectangle>
            </DockPanel>
            <ContentControl x:Name="PART_FindToolBarHost" Grid.Column="0" Focusable="{TemplateBinding Focusable}" Grid.Row="2" TabIndex="2"/>
          </Grid>
        </Border>
      </ControlTemplate>
    </Setter.Value>
  </Setter>
</Style>


However when I try it the scroll arrows are missing and the three dashes are missing from the middle of the bars. What do I need to do to correctly style a DocumentViewer to have the same scroll bar style as the Report controll?
Dennis
Top achievements
Rank 1
 answered on 14 Sep 2016
1 answer
158 views
Hi All,

I have a requirement to get the data from telerik radgridview and pass it to view model for manipulation.  The data in the grid may be after filtering/sorting/pagination and I want to get the collection from the grid that is presently in the grid and sent it to delegate command for operation.  I have placed a button to call Approve delegate command and I want to pass the gridview collection to the particular delegate method.

Can any one help me how can I pass filtered grid view collection to view model command?


<Button Height="30" Width="30" Margin="1,0,0,0" ToolTip="Approve" Command="{Binding Approve}" Cursor="Hand"></Button>

<telerik:RadGridView x:Name="GridView">
....
....
</telerik:RadGridView>

<telerik:RadDataPager Margin="5,0,15,0" x:Name="GridviewPager" Source="{Binding Items, ElementName=GridView}" PageSize="33" />

Thanks
Selvakumar R
Selvakumar
Top achievements
Rank 1
 answered on 13 Sep 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
Slider
Expander
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
WebCam
CardView
DataBar
Licensing
FilePathPicker
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
HighlightTextBlock
Security
TouchManager
StepProgressBar
VirtualKeyboard
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?