Telerik Forums
UI for WPF Forum
1 answer
98 views
I want to set the line style in my chart but I don't know what type to target in the style.  The documentation does not not say.  Line?  Path?  Something else?
Joe
Top achievements
Rank 2
Iron
Iron
Veteran
 answered on 14 Nov 2019
1 answer
108 views

Hi All
I would like to prevent the transition control from showing any transition/animation under certain conditions. For example, the content is bound to an enum field, for certain enum values I dont want it to transition.
I have tried using IValueConverter     

public class DispatchContentTransitionConverter : IValueConverter
    {
        public TransitionProvider TransitionForward { get; set; }
        public TransitionProvider TransitionBackward { get; set; }
        public TransitionProvider NoTransition { get; set; }
 
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value == null) return NoTransition;
            KeyValuePair<int, string> OSDispatchStatus = (KeyValuePair<int, string>)value;
            if (OSDispatchStatus.Key == SettingsConsts.OS_DispatchStatus_ReadytoBookCollection)
            {
                return TransitionForward;
            }
            else
            {
                return NoTransition;
            }
        }
 
        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }

 

But for this option I cannot set a "No Transition" transition

Second option tried: Setting Duration of the transition on TransitionStatusChanged, but this option only applies to the "Next" transition called not the current

private void MainTransControl_TransitionStatusChanged(object sender, Telerik.Windows.Controls.TransitionControl.TransitionStatusChangedEventArgs e)
       {
           OrderDispatchModel VM = DataContext as OrderDispatchModel;
           if (VM != null )
           {
               if (VM.OSDispatchStatus.Key == SettingsConsts.OS_DispatchStatus_ReadytoBookCollection)
               {
                   this.MainTransControl.Duration = new TimeSpan(0, 0, 1);
               }
               else
               {
                   this.MainTransControl.Duration = new TimeSpan(0, 0, 0);
               }
           }
           else
           {
               this.MainTransControl.Duration = new TimeSpan(0, 0, 0);
           }
       }

 

Anyone have any ideas of how to implement this?

 

Vladimir Stoyanov
Telerik team
 answered on 14 Nov 2019
1 answer
192 views

Hi everybody.

I'm facing an issue with telerik's RadRibbonView for WPF controls. I set the focus through code by calling ribbonView.Focus(), but afterwards I can not move focus to buttons inside ribbon view. I tried setting IsTabStop on ribbon buttons manually, but it didn't work either. Sample Xaml code is as follows:

<telerik:RadRibbonWindow
    x:Class="WpfRadRibbonFocusIssue.MainWindow"
    xmlns:local="clr-namespace:WpfRadRibbonFocusIssue"
    Title="MainWindow"
    Width="800"
    Height="450"
    mc:Ignorable="d">
    <telerik:RadRibbonWindow.Resources>
        <Style x:Key="FocusedStyle">
            <Setter Property="Control.Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Rectangle Stroke="Blue" StrokeThickness="1" />
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </telerik:RadRibbonWindow.Resources>
 
    <DockPanel>
        <telerik:RadRibbonView
            x:Name="ribbonView"
            DockPanel.Dock="Top"
            FocusVisualStyle="{StaticResource FocusedStyle}">
            <telerik:RadRibbonTab Header="Tab 01">
                <telerik:RadRibbonGroup Header="Group 01">
                    <telerik:RadRibbonButton IsTabStop="True" Text="Hello" />
                    <telerik:RadRibbonButton IsTabStop="True" Text="Hello 2" />
                    <telerik:RadRibbonButton IsTabStop="True" Text="Hello 3" />
                </telerik:RadRibbonGroup>
            </telerik:RadRibbonTab>
            <telerik:RadRibbonTab Header="Tab 02">
                <telerik:RadRibbonGroup Header="Group 02">
                    <telerik:RadRibbonButton Text="Command 01" />
                    <telerik:RadRibbonButton Text="Command 02" />
                    <telerik:RadRibbonButton Text="Command 03" />
                </telerik:RadRibbonGroup>
            </telerik:RadRibbonTab>
        </telerik:RadRibbonView>
    </DockPanel>
</telerik:RadRibbonWindow>
Dinko | Tech Support Engineer
Telerik team
 answered on 14 Nov 2019
4 answers
1.2K+ views

Hi there,

I have a DataTemplate that is added as TitleTemplate to a RadDocumentPane - as you see below. So I need to access to RadToggleButton which is inside my DataTemplate in code behind, can you please tell me how can i do that?

 

    <Window.Resources>
        <DataTemplate x:Key="SyncTemplate">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <ContentPresenter Content="{Binding}" Margin="0,5,0,0"/>
                <telerik:RadToggleButton x:Name="xScrollSync" Grid.Column="1" HorizontalAlignment="Right" Content="XScroll Sync" Width="75" />
            </Grid>
        </DataTemplate>
    </Window.Resources>

 

    <Grid>
<telerik:RadDocking Margin="0 60 0 30" HorizontalAlignment="Stretch" Height="auto"
                            HasDocumentHost="False" Width="auto" VerticalAlignment="Stretch">
<telerik:RadSplitContainer telerik:ProportionalStackPanel.RelativeSize="1000, 200">
<telerik:RadSplitContainer x:Name="ganttViewSplit" InitialPosition="DockedLeft"
                                       HorizontalAlignment="Stretch" Height="auto"
                                       VerticalAlignment="Stretch" telerik:ProportionalStackPanel.RelativeSize="800,200">
        <telerik:RadPaneGroup>
            <telerik:RadDocumentPane x:Name="ganttDoc" TitleTemplate="{StaticResource SyncTemplate}">
             <telerik:RadDocumentPane.Content>
                                <Grid>
                                </Grid>
                      </telerik:RadDocumentPane.Content>
           </telerik:RadDocumentPane>
        </telerik:RadPaneGroup>
   </telerik:RadSplitContainer>
</telerik:RadDocking>

</Grid>

Bahram
Top achievements
Rank 1
 answered on 13 Nov 2019
10 answers
992 views

Ok, stupid beginner question here, but how do I visually edit what goes into each tab for WPF UI Desktop using Visual Studio 2019?

When I drag the Tab Control into the design window, it places it just fine.  But, if I try to add anything, the items do not show up per tab.  Is there some trick to be able to edit a multi-tab XAML document visually?

Martin Ivanov
Telerik team
 answered on 13 Nov 2019
3 answers
243 views
Hi 
how can i make the color picker has only one button, so if the user press everywhere then the drop down open.

i use this event code to do this task but i hope there is a build in functionality to do that

        private void RadColorPicker_MouseUp(object sender, MouseButtonEventArgs e)
        {
            if (e.OriginalSource is RadButton && sender is RadColorPicker)
                (sender as RadColorPicker).IsDropDownOpen = true;
        }


Thanks,
Akram 
Dilyan Traykov
Telerik team
 answered on 13 Nov 2019
1 answer
49 views

I had a question on using Teleriks GridView component.

1. If I bind my GridView to a database table, how can I make certain columns editable when the user clicks into that specific column?

2. Also, the editing needs to support different box types, i.e, one of the columns should become an editable drop down combo box when the user clicks into it as opposed to display a drop drop down box for every row of that column if you see what I mean

Any examples would be much appreciated.

Thanks in advance!

Dilyan Traykov
Telerik team
 answered on 13 Nov 2019
2 answers
255 views

Hello,

I want to provide a Radslider with ranged selection, but I have an issue with the ticks.

As you can see on the screenshots I provided (Min and Max show the selected value in them), the offset of the ticks to the actual selection can be quite heavy on the first thumb.

I assume this is because you want to enable people to selecte a range from one value to the exact same value with both thumbs. However, in this case I do not need that and rather have the thumbs not be able to select the same value - and thus be able to have exact tick captions. Because as it is right now, users will not like it. It is counter-intuitive.

Is there any way right now to solve this issue?

Xaml-Code:

<StackPanel Grid.Row="1" Orientation="Vertical" Margin="8">
            <telerik:Label x:Name="sliderlabel" HorizontalAlignment="Center" HorizontalContentAlignment="Center" FontWeight="Bold" Margin="0"/>
            <telerik:RadSlider x:Name="slider" Orientation="Horizontal" HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch" Margin="0"
                           IsDeferredDraggingEnabled="True" HandlesVisibility="Visible" IsSnapToTickEnabled="False" IsMoveToPointEnabled="False" MiddleThumbClickMode="DecreaseNearestThumb" IsSelectionRangeEnabled="True" AutoToolTipPlacement="BottomRight" TickPlacement="TopLeft"
                           SelectionStartChanged="Slider_SelectionStartChanged" SelectionEndChanged="Slider_SelectionEndChanged" DragCompleted="Slider_DragCompleted">
                <telerik:RadSlider.AutoToolTipContentTemplate>
                    <DataTemplate>
                        <TextBlock Text="{Binding .,StringFormat=N0}"/>
                    </DataTemplate>
                </telerik:RadSlider.AutoToolTipContentTemplate>
                <telerik:RadSlider.TickTemplate>
                    <DataTemplate>
                        <Grid HorizontalAlignment="Left">
                            <TextBlock HorizontalAlignment="Left" TextAlignment="Left" Text="{Binding}" FontSize="10"/>
                        </Grid>
                    </DataTemplate>
                </telerik:RadSlider.TickTemplate>
            </telerik:RadSlider>
        </StackPanel>
Petar Mladenov
Telerik team
 answered on 13 Nov 2019
2 answers
256 views

Hi,

I've been using custom Group Descriptors on my RadGridView so I can specify the order the groups are sorted into however on these custom groups, (an example of how I create the descriptor is below), the column aggregates do not show. But if I do not override the group descriptor the column aggregates show on the row groups correctly. Is it possible for me to show these aggregate values on my custom groups?

Thanks for your help!!

01.private GroupDescriptor<PnlPosition, string, DateTime> GetInstrumentIdGroupDescriptor(ListSortDirection dir)
02.        {
03.            var descriptor = new GroupDescriptor<PnlPosition, string, DateTime>
04.            {
05.                GroupingExpression = o => o.InstrumentId.ToString(),
06.                GroupSortingExpression = group => group.ElementAt(0).Expiry.Value,
07.                SortDirection = dir,
08.                DisplayContent = "InstrumentId",
09.            };
10.            return descriptor;
11.        }
12. 
13.        private void PositionResultsGridView_Grouping(object sender, Telerik.Windows.Controls.GridViewGroupingEventArgs e)
14.        {
15.            if (e.Action == GroupingEventAction.Place)
16.            {               
17.                var columnGroup = e.GroupDescriptor as ColumnGroupDescriptor;
18.                if (columnGroup != null && columnGroup.Column.UniqueName == "InstrumentId")
19.                {
20.                    // cancel the default grouping
21.                    e.Cancel = true;
22.                    var descriptor = GetInstrumentIdGroupDescriptor(e.GroupDescriptor.SortDirection ?? ListSortDirection.Descending);
23.                     
24.                    //descriptor.AggregateFunctions = columnGroup.A
25.                    // add the new descriptor
26.                    ((RadGridView)sender).GroupDescriptors.Add(descriptor);
27.                }
28.                else if (columnGroup != null && columnGroup.Column.UniqueName == "Underlying")
29.                {
30.                    // cancel the default grouping
31.                    e.Cancel = true;
32.                    // add the new descriptor
33.                    var descriptor = GetUnderlyingGroupDescriptor(e.GroupDescriptor.SortDirection ?? ListSortDirection.Descending);
34.                    ((RadGridView)sender).GroupDescriptors.Add(descriptor);
35.                }
36.            }
37.        }

 

 

Vladimir Stoyanov
Telerik team
 answered on 13 Nov 2019
2 answers
335 views

I have an issue when loading the layout on Raddock. I'm trying to cancel a view loading if the users access has been revoked. However when I do LayoutSerializationCustomLoadingEventArgs.Cancel = true and return from OnCustomElementLoading I get the following error.

System.ArgumentOutOfRangeException
  HResult=0x80131502
  Message=Specified argument was out of the range of valid values.
Parameter name: elementTypeName
  Source=Telerik.Windows.Controls.Docking
  StackTrace:
   at Telerik.Windows.Controls.Docking.DefaultDockingLayoutFactory.NotifyCustomElementLoading(String elementTypeName, String serializationTag, Dictionary`2 attributes)
   at Telerik.Windows.Controls.Docking.DefaultDockingLayoutFactory.ReadPaneXml(XmlReader reader)
   at Telerik.Windows.Controls.Docking.DefaultDockingLayoutFactory.LoadPaneGroup(LoadingParentElementArgs args)
   at Telerik.Windows.Controls.Docking.DefaultDockingLayoutFactory.LoadSplitContainer(LoadingParentElementArgs args)
   at Telerik.Windows.Controls.Docking.DefaultDockingLayoutFactory.LoadDocking(LoadingParentElementArgs args)
   at Telerik.Windows.Controls.Docking.DefaultDockingLayoutFactory.LoadLayout(XmlReader reader)
   at Telerik.Windows.Controls.RadDocking.LoadLayout(Stream source, Boolean raiseEventsIfNoSerializationTag)
   at MyApp.LoadLayout(LoadLayoutEventParameters loadLayoutEventParameters) in.. 

Here is the code:

 

public void LoadLayout(LoadLayoutEventParameters loadLayoutEventParameters)
{
     using (FileStream layoutFile = new FileStream(Path.Combine(this.configPath, this.layoutFilename), FileMode.Open))
      {
             radDocking.LoadLayout(layoutFile);
      }
}

 

My views inherit RadPane so I use CustomElementLoading.

this.radDocking.CustomElementLoading += this.MyApp.OnCustomElementLoading;

 

 

public void OnCustomElementLoading(object sender, Telerik.Windows.Controls.LayoutSerializationCustomLoadingEventArgs e)
{
    if (!userCanAccess)
    {
          e.Cancel = true;
          return;
    }
    e.SetAffectedElement(MyAppView);
 
}

 

Here is my xaml

<telerik:RadDocking Grid.Row="2" x:Name="radDocking"
                            BorderThickness="0"
                            HasDocumentHost="False">
 
            <telerik:RadDocking.DockingPanesFactory>
                <docking:ShellDockingPanesFactory />
            </telerik:RadDocking.DockingPanesFactory>
 
            <telerik:RadDocking.GeneratedItemsFactory>
                <docking:CustomDefaultGeneratedItemsFactory />
            </telerik:RadDocking.GeneratedItemsFactory>
 
            <telerik:RadSplitContainer Orientation="Vertical" InitialPosition="DockedLeft">
                <telerik:RadPaneGroup HorizontalAlignment="Left"  x:Name="leftGroup" telerik:RadDocking.SerializationTag="leftGroup" />
            </telerik:RadSplitContainer>
            <telerik:RadSplitContainer InitialPosition="DockedRight" >
                <telerik:RadPaneGroup HorizontalAlignment="Right" x:Name="rightGroup" telerik:RadDocking.SerializationTag="rightGroup"/>
            </telerik:RadSplitContainer>
            <telerik:RadSplitContainer InitialPosition="DockedBottom" >
                <telerik:RadPaneGroup x:Name="bottomGroup" telerik:RadDocking.SerializationTag="bottomGroup"/>
            </telerik:RadSplitContainer>
            <telerik:RadSplitContainer InitialPosition="DockedTop" >
                <telerik:RadPaneGroup x:Name="topGroup" telerik:RadDocking.SerializationTag="topGroup"/>
            </telerik:RadSplitContainer>
            <telerik:RadSplitContainer InitialPosition="FloatingOnly" >
                <telerik:RadPaneGroup x:Name="floatingOnlyGroup" telerik:RadDocking.SerializationTag="floatingOnlyGroup"/>
            </telerik:RadSplitContainer>
            <telerik:RadSplitContainer InitialPosition="FloatingDockable" >
                <telerik:RadPaneGroup x:Name="floatingDockableGroup" telerik:RadDocking.SerializationTag="floatingDockableGroup"/>
            </telerik:RadSplitContainer>
        </telerik:RadDocking>

 

How can I control which views are loaded from the saved layout at runtime? I think it would get a bit messy if I start parsing the saved layout file and removing views. I usually save the layout when the app closes, this will remove the views the user can no longer access because I'm hoping they won't open in the first place if the access is revoked.

 

YBOT
Top achievements
Rank 1
Veteran
 answered on 12 Nov 2019
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
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
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?