Also, can't install the SDK Sample Browser (it says I need sharepoint, which I installed and it still says I don't can't install it.. anyways it looks like old stuff why not use a recent installer?).
Honestly, I tried a month ago Devexpress, and I found their product WAY MORE easier to use; the theming mechanism is super intuitive (ThemeManager.ThemeName="Win11Light" that's it, just out of the box). Unless I'm missing something with Telerik?
I hope you can help me so I can eventually enjoy Telerik which looks nice in the Demo (But I wasted A LOT of time trying to resolve these 2 issues (theme and installing the SDK Browser)
Thank you.
Hi,
I would like to use windows11 theme in my application, but when apply the theme every buttons in the toolbars are loaded of large padding and large margin.
Since I don't like this layout I can change it setting properties inside every button, but if I try to setting a style it is ignored.
I think that toolbar apply a style and overwrite my one.
Can I modify the layout without change every button in my application?
Thank you
Luigi
Hey :)
is it possible, to let a RadToolBarTray or RadToolBar automatically use a second row if there is not enough space?
I know I can manuelly set Bands but then it will be always 2 rows. Even if there would be enough space.
Greetings
Benedikt
Hi all!
This question is not accurate enough, the actual problem is described here: https://www.telerik.com/forums/radtoolbartray-itemtemplateselector-problems
***
I have not updated my Telerik components for years; last time I did, the radToolbars stopped working, and I have not had the time to look into it. So I reverted back to what worked, but now I feel it's time to get back on the track.
So here we go: programmatically generated toolbars on my main form do not display any buttons. I use toolbar and button view models that the UI components bind to. The entire set of toolbar viewmodels are built on the fly, and only empty toolbars show up. I have other UI components which have buttonless toolbar components placed onto them at design time, and those work when I add the buttons runtime, so the only difference I've found has to do with the non-working toolbars not existing at design time.
They work in RCWPF 2018.3.1016.45, so that's what I'm still using. This happened when I (briefly) upgraded to 2020.2.513.45, and the problem still exists in the current version.
The images show the two different versions. The dockable Conceptual model window contains an empty-at-design-time toolbar, which is populated when the UI is initialized. The main window contains a toolbar container which does not contain any toolbar components at design time.
Does anything come to mind immediately? If not, I will dig into my code.
And to be clear, the generated toolbarviewmodel has several buttonviewmodels on it. The same code builds the viewmodels in both cases.
Hi!
I have my own toolbar class, derived directly from RadToolbar:
<telerik:RadToolBar x:Class="MyNS.Components.MyToolbar"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
xmlns:viewmodel="clr-namespace:MyNS.ViewModel;assembly=MyNS.ViewModel"
d:DataContext="{d:DesignInstance Type=viewmodel:ToolbarViewModel}"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300"
VerticalAlignment="Top"
DataContext="{Binding}"
Visibility="{Binding ToolbarVisible, Converter={StaticResource BoolToVisibility}}"
ItemTemplateSelector="{StaticResource ToolbarElementTemplateSelector}"
ItemsSource="{Binding Elements}"
Band="{Binding Band}"
BandIndex="{Binding BandIndex}"
>
</telerik:RadToolBar>
with
public partial class MyToolbar : RadToolBar
{
public MyToolbar()
{
InitializeComponent();
}
}
When I add this toolbar design time on my child forms it works nicely. The underlying ToolbarViewModel binds all the way, and I get the buttons I want when I run the app.
But when dynamically instantiating new ToolbarViewModels to be shown on my MainWindow, I get empty buttonless RadToolbar instances, not MyToolbar instances. So I want to control what kind of toolbar gets instantiated. I have this in MainWindow.xaml:
<telerik:RadWindow x:Class="MyNS.MainWindow"
...
<telerik:RadToolBarTray
Name="Toolbars"
Grid.Row="1"
ItemsSource="{Binding Path=Toolbars}"
IsLocked="False"
ItemTemplateSelector="{StaticResource ToolbarTemplateSelector}"
/>
</telerik:RadWindow>
The binding itself works. I get RadToolbars, but without any buttons on them. But I get the wrong kind of toolbar, and I thought the ToolbarTemplateSelector would do it, but it never gets called.
So I have:
public class ToolbarTemplateSelector : DataTemplateSelector
{
public override DataTemplate SelectTemplate(object item, DependencyObject container)
{
// currently only one toolbar template
// THIS CODE IS NEVER RUN
return this.MyToolbarTemplate;
}
public DataTemplate MyToolbarTemplate { get; set; }
}
and DataTemplate.xaml
<ResourceDictionary
...
<!-- compile error if removed, so the mainwindow reference correctly points to this -->
<vm:ToolbarTemplateSelector
x:Key="ToolbarTemplateSelector"
MyToolbarTemplate="{StaticResource dtMyToolbar}"
/>
</ResourceDictionary>
and in PaneTemplate.xaml I have:
<ResourceDictionary
...
<!-- app crashes on start if this is removed -->
<DataTemplate x:Key="dtMyToolbar" DataType="{x:Type vm:ToolbarViewModel}">
<components:MyToolbar />
</DataTemplate>
</ResourceDictionary>
In my mind, whenever a new ToolbarViewModel is added to the Toolbars collection, the ToolbarTemplateSelector should instantiate a MyToolbar instance for it, and not a RadToolbar instance.
I have no idea what's missing.
Oh, I also tested with:
<telerik:RadWindow x:Class="MyNS.MainWindow"
...
<telerik:RadToolBarTray
Name="Toolbars"
Grid.Row="1"
ItemsSource="{Binding Path=Toolbars}"
IsLocked="False"
>
<DataTemplate>
<ksc:MyToolbar/>
</DataTemplate>
</telerik:RadToolBarTray>
...
</telerik:RadWindow>
But then the app crashes with the error message "Items collection must be empty before using ItemsSource." before the main window shows up. I don't see why that would happen, as the toolbartray is definitely empty at first.
Appreciate any help,
Kim
Having an issue where I have put a textbox in a toolbar.
The textbox Text is bound to a property of a Viewmodel but the setter does not get exercised.
it seems as though focus is never lost from the textbox even if the next item does receive focus.
I would have sworn I have used this setup before without issue.
I pulled the code into a simpler project just to verify I was not crazy and it acted the same.
if I pull the textbox out of the toolbar it works fine.
It must be something stupid I am doing. but i cant see it. What am I doing wrong.
Any help would be appreciated
<telerik:RadToolBarTray Width="400" >
<telerik:RadToolBar >
<TextBox Text="{Binding Main.Cali ,Mode=TwoWay}" Width="100" />
</telerik:RadToolBar>
</telerik:RadToolBarTray>
Thanks
Dave.
<
telerik:RadToolBarTray
telerikQuickStart:ThemeAwareBackgroundBehavior.IsEnabled
=
"True"
ItemsSource
=
"{Binding MergedToolbarCommands}"
x:Name
=
"ToolbarTray"
>
<
telerik:RadToolBarTray.ItemTemplate
>
<
DataTemplate
>
<
telerik:RadToolBar
ItemsSource
=
"{Binding}"
OverflowMode
=
"AsNeeded"
>
<
telerik:RadToolBar.ItemContainerStyle
>
<
Style
TargetType
=
"{x:Type ContentPresenter}"
>
<
Setter
Property
=
"ToolBar.OverflowMode"
Value
=
"Never"
/>
</
Style
>
</
telerik:RadToolBar.ItemContainerStyle
>
</
telerik:RadToolBar
>
</
DataTemplate
>
</
telerik:RadToolBarTray.ItemTemplate
>
</
telerik:RadToolBarTray
>