Telerik Forums
UI for WPF Forum
1 answer
300 views

I don't remember where I got it, but I have some code:

 

Dim ColumnSeries As New Telerik.Windows.Controls.ChartView.BarSeries
ColumnSeries.PointTemplate = TryCast(Application.Current.TryFindResource("ColumnDataPointTemplate"), DataTemplate)

 

And in a resource dictionary: 

<DataTemplate x:Key="ColumnDataPointTemplate">
    <Rectangle Fill="{Binding Brush}" MaxWidth="40"/>
</DataTemplate>

 

It works fine for the Bar series but fails to display anything if I use the same resource for the point template of a RangeBarSeries. I found somewhere in a forum post I think to use DefaultVisualStyle and that does work to set the max width, BUT it does not center the bar on the category label tick.

<Style x:Key="RangeBarVisualStyle" TargetType="Border">
    <Setter Property="Background" Value="{Binding Brush}" />
    <Setter Property="BorderThickness" Value="0"/>
    <Setter Property="MaxWidth" Value="40"/>
    <Setter Property="HorizontalAlignment" Value="Center"/>
</Style>

It does the same thing if I use the visual style on the regular bar so I know it is not specific to the range bar.

In the attached picture, I am showing the bars with no point template or default visual style. The second is with a point template, and the last is with the default visual style.

I would like to make either of these work... I don't really care which one.

Martin Ivanov
Telerik team
 answered on 05 Sep 2019
2 answers
312 views

How to get a round button that mimics the used Office2016Theme ?

There's some buttons in our app we'd like to be the same as the round Office2016Theme'd buttons that appear in other controls such as the Expander (open/close).

See attached pic as an example.

Dimitar Dinev
Telerik team
 answered on 05 Sep 2019
2 answers
160 views

Hello,

 

Can anyone tell me how can I set my own template of event on time ruler?

I have field called SubTitle and EventContainer style like below:

 

 <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="telerik:EventContainer">
                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="*"/>
                                            <ColumnDefinition Width="Auto"/>
                                        </Grid.ColumnDefinitions>
                                        <Grid Grid.Column="0" Margin="{TemplateBinding Padding}">
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="*" />
                                                <RowDefinition Height="Auto" />
                                            </Grid.RowDefinitions>
                                            <TextBlock Text="{Binding SubTitle}" />

                                        </Grid>
                                    </Grid>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>

 

But nothing is displaying. If I change binding to Title, it works.

Dilyan Traykov
Telerik team
 answered on 05 Sep 2019
7 answers
165 views

Hi,

resizing RibbonWindow works fine, but when the mouse is over the right upper part of the RadRibbonTab resizing is not possible. I don't suppose this is by design?

Best regards

Michael

Dilyan Traykov
Telerik team
 answered on 05 Sep 2019
1 answer
286 views

 

Hello,

Is it possible to perform validation on keypress instead of lost focus, similar to UpdateSourceTrigger in WPF?

I'm using the WPF RadPropertyGrid control with AutoGeneratePropertyDefinitions set to true.

 

                    <t:RadPropertyGrid Name="VdiPropertyGrid"  Grid.Column="2" 
                                      Item="{Binding Path=DataContext.SelectedPropertyInspector, RelativeSource={RelativeSource FindAncestor,  AncestorType={x:Type UserControl}}}"
                                      HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"    IsGrouped ="True"                        
                                      ScrollViewer.CanContentScroll="False" ScrollViewer.VerticalScrollBarVisibility="Auto"
                                      DescriptionPanelVisibility="Visible" SearchBoxVisibility="Visible" ForceCursor="True" SelectionMode="Single" 
                                      AutoGeneratePropertyDefinitions="True"                                   
                                      AutoGeneratingPropertyDefinition="RadPropertyGrid_OnAutoGeneratingPropertyDefinition" ItemChanged="VdiPropertyGrid_ItemChanged"    >

                        <t:RadPropertyGrid.Resources>
                            <Style TargetType="{x:Type TextBox}">
                                <Style.Triggers>
                                    <Trigger Property="Validation.HasError" Value="True">
                                        <Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Self}, Path=(Validation.Errors)[0].ErrorContent}" />
                                    </Trigger>
                                </Style.Triggers>
                            </Style>


                        </t:RadPropertyGrid.Resources>
                    </t:RadPropertyGrid>

 

Regards,
Canice.

Dinko | Tech Support Engineer
Telerik team
 answered on 05 Sep 2019
4 answers
2.2K+ views

I need to step through a call stack to determine why an unexpected event is being fired in my code. I am unable to do so in the Telerik libraries (e.g. Telerik.Windows.Controls.dll).

How do I go about getting the source code or debug symbols for UI for WPF?

Martin Ivanov
Telerik team
 answered on 04 Sep 2019
4 answers
198 views
I have read every bit of information there is on the RadCollectionNavigator, not much out there, so now I have to ask (-:

I would like to:
- Validate before accepting a new item
- Undo a new item
- Ask fro delete confirmation
- Know how to set focus on the new item in a rad listbox

Can I do this with the RadCollectionNavigator or do I have to find another solution?
Amit
Top achievements
Rank 1
 answered on 04 Sep 2019
19 answers
2.5K+ views
Is there a way to bind the double click command of a RadGridView to a command on the ViewModel instead of to an event?

<Controls:RadGridView.InputBindings> 
    <MouseBinding Gesture="LeftDoubleClick" Command="{Binding RecipeSelectedCommand}"/>  
</Controls:RadGridView.InputBindings> 
 


I'm getting

System.Windows.Markup.XamlParseException occurred
  Message="A 'Binding' cannot be set on the 'Command' property of type 'MouseBinding'. A 'Binding' can only be set on a DependencyProperty of a DependencyObject."
  Source="PresentationFramework"
  LineNumber=0
  LinePosition=0
  StackTrace:
       at MS.Internal.Helper.CheckCanReceiveMarkupExtension(MarkupExtension markupExtension, IProvideValueTarget provideValueTarget, DependencyObject& targetDependencyObject, DependencyProperty& targetDependencyProperty)
       at System.Windows.Data.BindingBase.ProvideValue(IServiceProvider serviceProvider)
       at System.Windows.Markup.BamlRecordReader.ProvideValueFromMarkupExtension(MarkupExtension markupExtension, Object obj, Object member)
       at System.Windows.Markup.BamlRecordReader.SetClrComplexPropertyCore(Object parentObject, Object value, MemberInfo memberInfo)
       at System.Windows.Markup.BamlRecordReader.SetClrComplexProperty(Object parentObject, MemberInfo memberInfo, Object o)
       at System.Windows.Markup.BamlRecordReader.SetPropertyValueToParent(Boolean fromStartTag, Boolean& isMarkupExtension)
       at System.Windows.Markup.BamlRecordReader.ReadElementEndRecord(Boolean fromNestedBamlRecordReader)
       at System.Windows.Markup.BamlRecordReader.ReadRecord(BamlRecord bamlRecord)
       at System.Windows.Markup.BamlRecordReader.Read(Boolean singleRecord)
       at System.Windows.Markup.TreeBuilderBamlTranslator.ParseFragment()
       at System.Windows.Markup.TreeBuilder.Parse()
       at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
       at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
       at CakeBoss.WPF.RecipeListView.InitializeComponent() in c:\Dev\CakeBoss2009\trunk\code\CakeBoss.WPF\RecipeList\RecipeListView.xaml:line 1
       at CakeBoss.WPF.RecipeListView..ctor() in C:\Dev\CakeBoss2009\trunk\code\CakeBoss.WPF\RecipeList\RecipeListView.xaml.cs:line 13
  InnerException:
paul
Top achievements
Rank 1
 answered on 03 Sep 2019
1 answer
1.7K+ views

I was previously using the Telerik EventToCommandBehavior to capture the double-click event for my GridView, but as others have discovered  I had the issue that it also triggered when a user clicked on the scrollbar quickly:

<telerik:EventToCommandBehavior.EventBindings>
  <telerik:EventBinding EventName="MouseDoubleClick" Command="{Binding ShowEditWindowCmd}" CommandParameter="{Binding SelectedItem, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type telerik:RadGridView}}}" />
</telerik:EventToCommandBehavior.EventBindings>

 

So now I've switched over to another solution using the code-behind, but it feels like it breaks the MVVM model too much in my case.  I realize I'm splitting hairs because this does what I want, but is there maybe a better (cleaner) way to do this?  I would love to use the EventToCommandBehavior on the row, but couldn't figure out how.

public partial class PackageBoardsGrid : UserControl
{
    PackageBoardsPage pageVM;
 
    public PackageBoardsGrid()
    {
        InitializeComponent();
        this.DataContextChanged += ( o, e ) =>
        {
            if( e.NewValue is PackageBoardsPage )
                pageVM = (PackageBoardsPage)e.NewValue;
        };
    }
 
    private void Grid_RowLoaded( object sender, Telerik.Windows.Controls.GridView.RowLoadedEventArgs e )
    {
        if( e.Row is GridViewRow ) {
            e.Row.AddHandler(GridViewRow.MouseDoubleClickEvent, new MouseButtonEventHandler(OnRowMouseDoubleClick), true);
        }
    }
 
    private void OnRowMouseDoubleClick( object sender, MouseButtonEventArgs args )
    {
        if( pageVM != null ) {
 
            var gridViewRow = sender as GridViewRow;
            if( gridViewRow != null ) {
                var data = gridViewRow.DataContext as LiveBoard;
                if( data != null )
                    pageVM.ShowEditWindowCmd.Execute(data);
            }
        }
    }
}
Martin Ivanov
Telerik team
 answered on 03 Sep 2019
3 answers
95 views

Hi,

I want to restrict which shapes can be connected. In my application there are rules of which shapes may be connected. What I want is that if a user tries to connect two shapes, that cannot be connected (incompatible?) it will reject the connection or display an error on the connection.

Can I do this?

Thx

Rob

Mark
Top achievements
Rank 1
 answered on 02 Sep 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
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
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
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?