Telerik Forums
UI for WPF Forum
1 answer
119 views
When one of my RadPanes is hiding/closing I want to check if something should have been saved.
I cannot find an event which could tell me that the RaPane is about to close/hide.

I see that one can use the RadDocking.PaneStateChanged.
But how can I find the RadPane's RadDocking?
George
Telerik team
 answered on 02 Dec 2010
4 answers
117 views
Hi,
I'm playing around with Miroslavs RadDocking example:
http://blogs.telerik.com/blogs/posts/09-08-31/using_the_raddocking_control_with_prism.aspx

When items are added to a RadPaneGroup by using Prism and the RadPaneGroupRegionAdapter they are not added as the base type RadPane. This is only a problem when I'm trying to serialize the Docking panels. SaveLayout() will produce this xml:

<RadDocking><SplitContainers><RadSplitContainer><Items><RadPaneGroup>
<Items><Pane1 Title=\"PaneAdded\"</Items></RadPaneGroup></Items>
</RadSplitContainer></SplitContainers></RadDocking>
(Removed some attributes)

As you can see there's an element called Pane1 which should be a RadPane in order for the LoadLayout() to parse the xml without throwning an ArgumentOutOfRangeException.

What would be the best way to get this working?

Regards
Arnstein
Arnstein
Top achievements
Rank 1
 answered on 02 Dec 2010
5 answers
211 views
Hi,

I want to display the dropdown on ToolWindow header same as it is displayed on PaneHeader. I tried to do so using control template, but the button gets disabled. How can I do this ?
George
Telerik team
 answered on 02 Dec 2010
3 answers
50 views
I am trying to use a vertical Splitter and a Horizontal Splitter to control four panes.  Is this possible?

Ed
George
Telerik team
 answered on 02 Dec 2010
3 answers
219 views
Hi I implemented the docking controls.
Now I need to implement the "View" menu that will have menuItem for each radPane and allow hide/show of the panes
Basically the View menu should allow open/hide any window/pane
(like windows in the Visual Studio)

Is there any example of an wpf menu (bind or with events) to the radPane(s)?

Thanks!
Felix
Top achievements
Rank 1
 answered on 02 Dec 2010
6 answers
128 views
Hello,

How do I make a search on my hierarchical data grid view that is on the bottom level?

Let's say I have a PurchaseOrder , PurchaseOrderDetails, and PurchaseOrderReceipts. 

Purchase Order - Parent

Purchase OrderDetails - Second

PurchaseOrderReceipts - Third

Is there a way I could search and filter fields that are on the level 3 hierarchy and find the corresponding items that are referenced in table 3. 

Let's say I have a ProductID on table 1 as PK, ProductOrderID on table 2 and LotID on table 3, when I want to search using LotID how do I display the rest of the details from level 3 to parent?
Maya
Telerik team
 answered on 02 Dec 2010
3 answers
154 views
Hoi.

Is it possible to signal a change of the visible period in the RadSchedulerView .
I need this for the following scenario.

Only a subset of the data is loaded. When the Visible period is changed, by the user, a round trip to the database will be performed. How can I see that the visible period is changed.

Thanks for the help

Cees
Konstantina
Telerik team
 answered on 02 Dec 2010
5 answers
207 views
Hello,

I started updating our styles earlier today an i ran into a problem with the GridViewGroupRow Style. For some reason i cant get it to display the aggregates.

Here is the style that I'm getting from blend.
<Style x:Key="GridViewGroupRowStyle1" TargetType="{x:Type telerik:GridViewGroupRow}"
            <Setter Property="Template"
                <Setter.Value> 
                    <ControlTemplate TargetType="{x:Type telerik:GridViewGroupRow}"
                        <Grid x:Name="PART_GroupExpanderGrid" Background="{TemplateBinding Background}"
                            <Grid.ColumnDefinitions> 
                                <ColumnDefinition Width="Auto"/> 
                                <ColumnDefinition Width="Auto"/> 
                                <ColumnDefinition Width="*"/> 
                            </Grid.ColumnDefinitions> 
                            <Grid.RowDefinitions> 
                                <RowDefinition x:Name="PART_HeaderRow" MinHeight="25"/> 
                                <RowDefinition x:Name="ContentRow"/> 
                            </Grid.RowDefinitions> 
                            <Border x:Name="ToggleButtonBorder" Grid.Column="2" Grid.ColumnSpan="2" Background="{TemplateBinding Background}" BorderBrush="#FF848484" BorderThickness="0,0,0,1"
                                <Border x:Name="ToggleButtonInnerBorder" BorderBrush="White" BorderThickness="1"
                                    <Grid> 
                                        <Grid.ColumnDefinitions> 
                                            <ColumnDefinition Width="25"/> 
                                            <ColumnDefinition Width="Auto"/> 
                                            <ColumnDefinition Width="*"/> 
                                        </Grid.ColumnDefinitions> 
                                        <Border HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Grid.Column="2"
                                            <telerik:AggregateResultsList HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" IsTabStop="False"
                                                <telerik:AggregateResultsList.ItemTemplate> 
                                                    <DataTemplate> 
                                                        <telerik:GridViewAggregateResultCell IsTabStop="False" AggregateResult="{Binding}"
                                                            <telerik:StyleManager.Theme> 
                                                                <telerik:Office_BlackTheme/> 
                                                            </telerik:StyleManager.Theme> 
                                                        </telerik:GridViewAggregateResultCell> 
                                                    </DataTemplate> 
                                                </telerik:AggregateResultsList.ItemTemplate> 
                                                <telerik:AggregateResultsList.ItemsPanel> 
                                                    <ItemsPanelTemplate> 
                                                        <StackPanel IsItemsHost="True" Orientation="Horizontal"/> 
                                                    </ItemsPanelTemplate> 
                                                </telerik:AggregateResultsList.ItemsPanel> 
                                            </telerik:AggregateResultsList> 
                                        </Border> 
                                        <Border x:Name="IconOuterBorder" HorizontalAlignment="Stretch" Margin="-1,-1,0,-2" Background="{TemplateBinding Background}" BorderBrush="#FF848484" BorderThickness="0,0,0,1" telerik:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical"
                                            <Border x:Name="IconInnerBorder" BorderBrush="White" BorderThickness="1,1,0,1"
                                                <Path x:Name="ExpanderButton" Fill="Black" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Width="7" Height="5" RenderTransformOrigin="0.5,0.5" Grid.Column="0" Data="M0,0L1,0 2,0 2,0.99999991 3,0.99999991 3,2 4,2 4,0.99999991 5,0.99999991 5,0 5.9999999,0 7,0 7,0.99999991 5.9999999,0.99999991 5.9999999,2 5,2 5,3 4,3 4,4 3,4 3,3 2,3 2,2 1,2 1,0.99999991 0,0.99999991z"
                                                    <Path.RenderTransform> 
                                                        <RotateTransform/> 
                                                    </Path.RenderTransform> 
                                                </Path> 
                                            </Border> 
                                        </Border> 
                                        <ToggleButton x:Name="HeaderButton" Background="{TemplateBinding Background}" Opacity="0" Grid.Column="0" Grid.ColumnSpan="3" IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" telerik:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical"/> 
                                        <ToggleButton Background="{TemplateBinding Background}" BorderBrush="{x:Null}" BorderThickness="0" Padding="0,0,10,0" Grid.Column="1" IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" telerik:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical"
                                            <ToggleButton.Style> 
                                                <Style TargetType="{x:Type ToggleButton}"
                                                    <Setter Property="Template"
                                                        <Setter.Value> 
                                                            <ControlTemplate TargetType="{x:Type ToggleButton}"
                                                                <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"
                                                                    <ContentPresenter Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" ContentTemplate="{TemplateBinding ContentTemplate}"/> 
                                                                </Border> 
                                                            </ControlTemplate> 
                                                        </Setter.Value> 
                                                    </Setter> 
                                                    <Setter Property="HorizontalContentAlignment" Value="Left"/> 
                                                    <Setter Property="VerticalContentAlignment" Value="Center"/> 
                                                    <Setter Property="Padding" Value="9,0,0,0"/> 
                                                </Style> 
                                            </ToggleButton.Style> 
                                            <ContentPresenter Margin="0,0,10,0" VerticalAlignment="Center" Grid.Column="1" Content="{TemplateBinding GroupViewModel}" ContentTemplate="{TemplateBinding GroupHeaderTemplate}"/> 
                                        </ToggleButton> 
                                    </Grid> 
                                </Border> 
                            </Border> 
                            <Border x:Name="PART_IndicatorPresenter" VerticalAlignment="Stretch" Width="25" Visibility="{TemplateBinding RowIndicatorVisibility}" Grid.Column="0" BorderBrush="#FF848484" BorderThickness="0,0,1,1" telerik:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical"
                                <Border Background="#FFE4E4E4" BorderBrush="White" BorderThickness="1"/> 
                            </Border> 
                            <telerik:IndentPresenter Background="{TemplateBinding Background}" IsTabStop="False" Grid.Column="1" telerik:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical" IndentLevel="{TemplateBinding Level}"
                                <telerik:StyleManager.Theme> 
                                    <telerik:Office_BlackTheme/> 
                                </telerik:StyleManager.Theme> 
                            </telerik:IndentPresenter> 
                            <Border x:Name="Content" Visibility="Collapsed" Grid.Column="0" Grid.ColumnSpan="5" Grid.Row="1"
                                <StackPanel> 
                                    <telerik:GridViewVirtualizingPanel x:Name="PART_GridViewVirtualizingPanel"/> 
                                    <telerik:GridViewGroupFooterRow x:Name="Footer" IsTabStop="False"
                                        <telerik:StyleManager.Theme> 
                                            <telerik:Office_BlackTheme/> 
                                        </telerik:StyleManager.Theme> 
                                    </telerik:GridViewGroupFooterRow> 
                                </StackPanel> 
                            </Border> 
                            <Border x:Name="BottomBorder" VerticalAlignment="Bottom" Visibility="Collapsed" Grid.Column="2" Grid.Row="1" BorderBrush="#FF848484" BorderThickness="0,0,0,1"/> 
                        </Grid> 
                        <ControlTemplate.Triggers> 
                            <Trigger Property="IsExpanded" Value="True"
                                <Trigger.EnterActions> 
                                    <BeginStoryboard> 
                                        <Storyboard> 
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)"
                                                <SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="180"/> 
                                            </DoubleAnimationUsingKeyFrames> 
                                        </Storyboard> 
                                    </BeginStoryboard> 
                                </Trigger.EnterActions> 
                                <Trigger.ExitActions> 
                                    <BeginStoryboard> 
                                        <Storyboard> 
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)"
                                                <SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="0"/> 
                                            </DoubleAnimationUsingKeyFrames> 
                                        </Storyboard> 
                                    </BeginStoryboard> 
                                </Trigger.ExitActions> 
                                <Setter Property="Visibility" TargetName="BottomBorder" Value="Visible"/> 
                                <Setter Property="Visibility" TargetName="Content" Value="Visible"/> 
                                <Setter Property="BorderThickness" TargetName="IconOuterBorder" Value="0"/> 
                                <Setter Property="BorderThickness" TargetName="IconInnerBorder" Value="1,1,0,0"/> 
                            </Trigger> 
                        </ControlTemplate.Triggers> 
                    </ControlTemplate> 
                </Setter.Value> 
            </Setter> 
            <Setter Property="GroupHeaderTemplate"
                <Setter.Value> 
                    <DataTemplate> 
                        <ContentPresenter Content="{Binding Header}"/> 
                    </DataTemplate> 
                </Setter.Value> 
            </Setter> 
            <Setter Property="Background" Value="#FFE4E4E4"/> 
            <Setter Property="BorderBrush" Value="#FFCBCBCB"/> 
            <Setter Property="BorderThickness" Value="0"/> 
            <Setter Property="VerticalContentAlignment" Value="Center"/> 
            <Setter Property="HorizontalContentAlignment" Value="Left"/> 
            <Setter Property="Padding" Value="10,0,0,0"/> 
            <Setter Property="SnapsToDevicePixels" Value="True"/> 
        </Style> 

Any ideas what I'm doing wrong?

Thanks Much,
~Boots
Maya
Telerik team
 answered on 02 Dec 2010
5 answers
181 views
Hi,

can we get the the Themes for all controls to the entire application (App Resource) as part of WPF Control bundle??

Thanks,
Suman
Vanya Pavlova
Telerik team
 answered on 02 Dec 2010
1 answer
159 views

I have just started working with Telerik controls having moved from Infragistics controls.

I have created a 3D pie chart in code-behind whose data is gathered from a database.

The legend items for the chart are also gathered from the database (both the title of each item and its colour is stored in the database as these colours are customisable by the user for each category).

I have managed to set the legend item colours correctly but now I need to set the colours of each 'slice' of the pie chart to match the legend.

I have followed the example on setting custom item styles at http://www.telerik.com/help/wpf/radchart-styling-and-appearance-custom-item-style.html but when I set a breakpoint on the BuildCustomItemStyles method it is only ever trying to style the legend items.

Here is my cod behind (including the BuildCustomItemStyles code).

/// <summary>
/// Interaction logic for AbsenceByReasonChart.xaml
/// </summary>
public partial class AbsenceByReasonChart : UserControl, IWpfChart
{
    private List<OptionPropertiesData> optionPropertiesSet;
    /// <summary>
    ///     Default constructor.
    /// </summary>
    public AbsenceByReasonChart()
    {
        InitializeComponent();
        radChart1.
        Loaded += new RoutedEventHandler(AbsenceByReasonChart_Loaded);
    }
    private void AbsenceByReasonChart_Loaded(object sender, RoutedEventArgs e)
    {
        WpfZoomUtils.ZoomChartArea(radChart1.DefaultView.ChartArea, Constants.WpfChartZoomFactor);
    }   
      
    private Style BuildCustomItemStyle(Control item, Style style, DataPoint point, DataSeries dataSeries) 
    
        if ((item as BaseChartItem3D<Pie3D>) == null) return style; 
        Style newStyle = new Style(); 
        newStyle.BasedOn = style; 
        newStyle.TargetType = typeof(Shape); 
        // this code gets the brush colour
        Brush brush = new SolidColorBrush(getOptionColour(...));
  
        newStyle.Setters.Add(new Setter(Shape.FillProperty, brush)); 
  
        return newStyle; 
    
    public void SetChartTitle(DateTime startDate, DateTime endDate)
    {
        if (startDate == DateTime.MinValue || startDate == null) return;
        radChart1.DefaultView.ChartTitle.Content = string.Format("Absence by Reason {0} to {1}", startDate.ToShortDateString(), endDate.ToShortDateString());
        radChart1.DefaultView.ChartTitle.HorizontalAlignment = HorizontalAlignment.Center;
    }
    public void PopulateChart(DataTable data, DateTime startDate, DateTime endDate, List<OptionPropertiesData> optionPropertiesList)
    {
        if (data == null || data.Rows.Count == 0 || optionPropertiesList == null || optionPropertiesList.Count == 0) return;
        optionPropertiesSet = optionPropertiesList;
        if (radChart1.DefaultView.ChartArea.DataSeries != null && radChart1.DefaultView.ChartArea.DataSeries.Count > 0)
        {
            // remove existing data series
            radChart1.DefaultView.ChartArea.DataSeries.Clear();
        }
        // define series data type
        DataSeries series = new DataSeries()
        {
            Definition = new Pie3DSeriesDefinition(),
            LegendLabel = "Attendance Type"
        };
        // turn on item tooltips and set the item format of the tooltip for each series item
        ISeries3DDefinition chartDefintion = series.Definition as Pie3DSeriesDefinition;
        if (chartDefintion != null)
        {
            chartDefintion.ShowItemToolTips = true;
            chartDefintion.ItemToolTipFormat = "#LEGENDLABEL: #Y Employees";
            chartDefintion.ItemLabelFormat = "#%{p0}";
        }
        // for the absence by reason chart, the legend colours must match the colours defined for each atendance type
        // in the attendance maintenance section
          
        // first, turn OFF the automatic generation of the legend for the chart
        radChart1.DefaultView.ChartLegend.UseAutoGeneratedItems = false;
        // whilst the chart is being populated, set the legend item appropriately
        foreach (DataRow r in data.Rows)
        {
            if (r == null || r.ItemArray == null || r.ItemArray.Length == 0) continue;
            // the item array of each data row has the following information:
            // first item is the absence reason
            // second item is the number of employees off due to this reason
            // third item is the id of the data option for the absence reason
            if (r.ItemArray[1] is int && r.ItemArray[0] is string && r.ItemArray[2] is long)
            {
                // ignore categories that have no value or rows where the absence reason data option id cannot be found
                if (Convert.ToInt32(r.ItemArray[1]) <= 0 || Convert.ToInt64(r.ItemArray[2]) <= 0) continue;
                // set the data for this category
                series.Add(new DataPoint 
                {                                        
                    XValue = Convert.ToInt64(r.ItemArray[2]),
                    YValue = Convert.ToInt32(r.ItemArray[1]), 
                });
                // now define its legend item
                ChartLegendItem legendItem = new ChartLegendItem()
                {
                    Background = new SolidColorBrush(getOptionColour(Convert.ToInt64(r.ItemArray[2]), optionPropertiesList)),
                    Label = Convert.ToString(r.ItemArray[0])
                };
                radChart1.DefaultView.ChartLegend.Items.Add(legendItem);
            }
        }
        SetChartTitle(startDate, endDate);
        // finally, assign the chart the defined data series
        radChart1.DefaultView.ChartArea.DataSeries.Add(series);
    }
    private System.Windows.Media.Color getOptionColour(long optionID, List<OptionPropertiesData> optionPropertiesList)
    {
        // find the option properties object for the option with the passed in option id
        // and return its associated colour
        OptionPropertiesData optionProperty = optionPropertiesList.Find(delegate(OptionPropertiesData opData) { return opData.getDataOptionID() == optionID; });
        if (optionProperty != null)
        {
            System.Drawing.Color winFormColour = System.Drawing.Color.FromArgb(optionProperty.getPlannerColour());
            if (winFormColour != null)
            {
                return new System.Windows.Media.Color()
                {
                    A = winFormColour.A,
                    R = winFormColour.R,
                    G = winFormColour.G,
                    B = winFormColour.G
                };
            }
        }
        return new Color();
    }
    public RadChart GetChartInstance()
    {
        return radChart1;
    }
Vladimir Milev
Telerik team
 answered on 02 Dec 2010
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?