I have a list of <Data>, which I use to bind to a VirtualGrid
Data:
-Value [InnerData]:
-- Name [string]
-- Description [string]
I use CellTemplateNeeded event handler to select a DataTemplate for the columns :
private void RadVirtualGrid_CellTemplateNeeded(object sender, CellTemplateEventArgs e)
{
e.DataTemplate = this.Resources["Template"] as DataTemplate;
}
<DataTemplate x:Key="Template">
<StackPanel>
<Label Content="{Binding Name}" />
<Label Content="{Binding Description}" />
</StackPanel>
</DataTemplate>
And then I use CellValueNeeded to set the Value:
private void RadVirtualGrid_CellValueNeeded(object sender, CellValueEventArgs e)
{
e.Value = viewModel.List[e.RowIndex].Value;
}
So, basically I want to be able to "bind" an object to the Value of the Column.
Then, I want to display multiple properties of the object in the DataTemplate.
It works fine with string data, for e.g.:
e.Value = viewModel.List[e.RowIndex].Value.Name
<Label Content="{Binding }" />
It doesn't work with objects:
e.Value = viewModel.List[e.RowIndex].Value
<Label Content="{Binding Name}" />A workaround was to "bind" to a string which contains both properties, $"{name}--#--{description}", then use a converter to get the name and description and display it.
But, I want to be able to pass an object, as I might need to display multiple properties.
Is there a limitation here? Can you recommend a better way to do it?
Thanks
In my project, there is radrichtextbox. I am trying to change fontfamily and basealignment of the text present inside the radrichtextbox whenever that radrichtextbox loads using below code.
radRichTextBox.FontFamily = new System.Windows.Media.FontFamily("Symbol");
radRichTextBox.ChangeBaselineAlignment(Telerik.Windows.Documents.Model.BaselineAlignment.Subscript);
But I see no change in the text. Am I missing something?
Hi,
I'm using a RadMultiColumnComboBox and can't seem to be able to set the validation error template to Tooltip using:
telerik:ValidationErrorTemplateHelper.DisplayMode="ToolTip"It always set the validation message on the right of the control, and in my case it's being clipped by the windows limits.
This usually works great on all other controls.
Thank you for your help
I'm getting a null reference exception when closing one of the pane and could not figure out why it is null in the RemovePane(RadPane pane) method.
We have override to that method,
protected override void RemovePane(RadPane pane)
{
if(pane.Header.ToString().ToLower()=="digital" || pane.Header.ToString().ToLower() == "analog")
SaveDebugPaneLayout(pane);
pane.DataContext = null;
pane.Content = null;
pane.ClearValue(RadDocking.SerializationTagProperty);
pane.RemoveFromParent();
}And also the CreatePaneForItem method,
protected override RadPane CreatePaneForItem(object item)
{
var viewModel = item as DebugPaneViewModel;
if (viewModel != null)
{
var pane = viewModel.IsDocument ? new RadDocumentPane() : new RadPane();
pane.DataContext = item;
if (viewModel.ContentType != null)
{
if (viewModel.GetType().ToString().EndsWith("EditorViewModel"))
{
if (pane.Content == null)
{
dynamic obj = Activator.CreateInstance(viewModel.ContentType);
pane.Content = obj;
obj.DataContext = viewModel;
}
}
else
{
pane.Content = Activator.CreateInstance(viewModel.ContentType);
}
}
RadDocking.SetSerializationTag(pane, viewModel.ID);
return pane;
}
return base.CreatePaneForItem(item);
}I am using the RadAutoCompleteBox as follows. I would like to display all Products when pressing the "Keyboard Down Arrow" on the RadAutoCompleteBox. Is this possible?
<telerik:RadAutoCompleteBox Height="23" Width="180" Background="#FFEDF4AB" Margin="3,0,0,0"
ItemsSource="{Binding Products}"
SelectedItem="{Binding SelectedProductItem, Mode=TwoWay}"
SelectionMode="Single"
TextSearchMode="StartsWith"
SearchText="{Binding Name, Mode=TwoWay}"
TextSearchPath="Name"
DisplayMemberPath="Name"
AutoCompleteMode="Suggest" >
<telerik:RadAutoCompleteBox.DropDownItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Name}" FontWeight="Bold" Foreground="Black" Width="200" />
</StackPanel>
</DataTemplate>
</telerik:RadAutoCompleteBox.DropDownItemTemplate>
<Behaviors:Interaction.Triggers>
<Behaviors:EventTrigger EventName="SelectionChanged">
<Behaviors:InvokeCommandAction Command="{Binding SelectProductCommand}" />
</Behaviors:EventTrigger>
</Behaviors:Interaction.Triggers>
</telerik:RadAutoCompleteBox>

Hello,
is there a way to style the RadToolBarOverflowPanel? Or add a template for its items?
I would like to display the button on the left side and show the tooltip next to it.
Any help would be appreciated.
Best regards :)
Hi, I have an issue trying to style RadDocking control.
I want that my PaneHeaders change their background when user selects them. I tried to modify RadPaneGroup ControlTemplate and RadPane Control Template, but with no luck. Could you please provide me detail sample for that?
One more question - how to correctly control height of the RadGroupHeader (Part where PaneHeaders *(tabs) are suited)? I simply dont understand which part of template should be responcible for that.
P.S. I am using Office 2019 theme.
As of 2024 Q4 (November), we will deprecate the .NET 7 distribution. This decision is rooted in our dedication to align with Microsoft’s recommended framework versions so that our products leverage the latest advancements in technology, security, and performance.
We are aligning our product with Microsoft’s lowest-supported framework versions for .NET Framework and .NET, respectively. Please refer to the following blog post: Product Update for Enhanced Performance and Security
For more information about how to upgrade your project when a new version of the Telerik UI for WPF suite is released, you can check here: Project Migration to .NET 4.6.2 and .NET 6
Can you please give a small example of "AStart Router" used in routing with tree layout.
I have customized filtering control along with behavior,
Im trying to use SearchBox control in distinct values filter ive tried "EnableDistinctValuesFiltering="True""
even though i have search box it doest work,
example: in this screenshot ive type pending but the list still remains the same
here is my style
<Style TargetType="telerik:FilteringControl">
<Setter Property="Background" Value="White" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="telerik:FilteringControl">
<Border
Margin="{TemplateBinding Margin}"
Background="White"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="1"
TextBlock.FontSize="11"
TextBlock.FontWeight="Normal">
<Border
Margin="1"
Background="{TemplateBinding Background}"
BorderBrush="LightGray"
BorderThickness="1">
<StackPanel
MinWidth="200"
MaxWidth="350"
Margin="5"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
<StackPanel x:Name="PART_DistinctFilter">
<Grid>
<telerik:RadButton
x:Name="PART_FilterCloseButton"
Width="15"
Height="15"
Margin="0,2"
Padding="1,-2,0,0"
HorizontalAlignment="Right"
Content="x"
FontSize="10"
FontWeight="Bold" />
</Grid>
<telerik:RadWatermarkTextBox
x:Name="PART_SearchBox"
Margin="0,0,0,4"
CurrentText="{Binding SearchText, Mode=TwoWay, TargetNullValue=''}"
WatermarkContent="{telerik:LocalizableResource Key=GridViewFilterDistinctValueSearch}">
<telerik:RadWatermarkTextBox.Style>
<Style BasedOn="{StaticResource {x:Type telerik:RadWatermarkTextBox}}" TargetType="{x:Type telerik:RadWatermarkTextBox}">
<Setter Property="Visibility" Value="Collapsed" />
<Style.Triggers>
<DataTrigger Binding="{Binding DataContext.FilterType, RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}, Mode=OneWay, UpdateSourceTrigger=PropertyChanged, FallbackValue=Collapsed}" Value="CustomLOV">
<Setter Property="Visibility" Value="Visible" />
</DataTrigger>
</Style.Triggers>
</Style>
</telerik:RadWatermarkTextBox.Style>
</telerik:RadWatermarkTextBox>
<ListBox
x:Name="PART_DistinctValuesList"
MaxHeight="250"
ItemsSource="{Binding DistinctValues}"
ScrollViewer.HorizontalScrollBarVisibility="Auto"
SelectionMode="Multiple">
<ListBox.ItemTemplate>
<DataTemplate>
<CheckBox
VerticalContentAlignment="Center"
Content="{Binding ConvertedValue}"
IsChecked="{Binding IsActive, Mode=TwoWay}">
<CheckBox.LayoutTransform>
<ScaleTransform ScaleX="0.9" ScaleY="0.9" />
</CheckBox.LayoutTransform>
</CheckBox>
</DataTemplate>
</ListBox.ItemTemplate>
<ListBox.Style>
<Style BasedOn="{StaticResource {x:Type ListBox}}" TargetType="{x:Type ListBox}">
<Setter Property="Visibility" Value="Collapsed" />
<Style.Triggers>
<DataTrigger Binding="{Binding DataContext.FilterType, RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}, Mode=OneWay, UpdateSourceTrigger=PropertyChanged, FallbackValue=Collapsed}" Value="CustomLOV">
<Setter Property="Visibility" Value="Visible" />
</DataTrigger>
</Style.Triggers>
</Style>
</ListBox.Style>
</ListBox>
</StackPanel>
<StackPanel Margin="0,2">
<TextBlock
Margin="0,2,0,0"
telerik:LocalizationManager.ResourceKey="GridViewFilterShowRowsWithValueThat"
Foreground="Black">
<TextBlock.Style>
<Style BasedOn="{StaticResource {x:Type TextBlock}}" TargetType="{x:Type TextBlock}">
<Setter Property="Visibility" Value="Visible" />
<Style.Triggers>
<DataTrigger Binding="{Binding DataContext.FilterType, RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}, Mode=OneWay, UpdateSourceTrigger=PropertyChanged, FallbackValue=Collapsed}" Value="CustomLOV">
<Setter Property="Visibility" Value="Collapsed" />
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<telerik:RadComboBox
x:Name="PART_Filter1ComboBox"
Margin="0,2"
ItemTemplate="{StaticResource ActionTemplate}"
ItemsSource="{Binding AvailableActions}"
SelectedItem="{Binding Filter1.Operator, Mode=TwoWay}">
<telerik:RadComboBox.Style>
<Style BasedOn="{StaticResource {x:Type telerik:RadComboBox}}" TargetType="{x:Type telerik:RadComboBox}">
<Setter Property="Visibility" Value="Visible" />
<Style.Triggers>
<DataTrigger Binding="{Binding DataContext.FilterType, RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}, Mode=OneWay, UpdateSourceTrigger=PropertyChanged, FallbackValue=Collapsed}" Value="Condition">
<Setter Property="Visibility" Value="Collapsed" />
</DataTrigger>
<DataTrigger Binding="{Binding DataContext.FilterType, RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}, Mode=OneWay, UpdateSourceTrigger=PropertyChanged, FallbackValue=Collapsed}" Value="CustomLOV">
<Setter Property="Visibility" Value="Collapsed" />
</DataTrigger>
</Style.Triggers>
</Style>
</telerik:RadComboBox.Style>
</telerik:RadComboBox>
<TextBox
x:Name="PART_Filter1TextBox"
Height="30"
Margin="0,2"
Padding="3,0"
VerticalContentAlignment="Center"
Text="{Binding Filter1.Value, Mode=TwoWay, Converter={StaticResource CommonValueConverter}, ConverterParameter=FilteringControl}">
<TextBox.Style>
<Style BasedOn="{StaticResource {x:Type TextBox}}" TargetType="TextBox">
<Setter Property="IsEnabled" Value="True" />
<Setter Property="Visibility" Value="Visible" />
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=PART_Filter1ComboBox, Path=SelectedItem}" Value="IsNull">
<Setter Property="IsEnabled" Value="False" />
</DataTrigger>
<DataTrigger Binding="{Binding DataContext.FilterType, RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}, Mode=OneWay, UpdateSourceTrigger=PropertyChanged, FallbackValue=Collapsed}" Value="Condition">
<Setter Property="Visibility" Value="Collapsed" />
</DataTrigger>
<DataTrigger Binding="{Binding DataContext.FilterType, RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}, Mode=OneWay, UpdateSourceTrigger=PropertyChanged, FallbackValue=Collapsed}" Value="CustomLOV">
<Setter Property="Visibility" Value="Collapsed" />
</DataTrigger>
</Style.Triggers>
</Style>
</TextBox.Style>
</TextBox>
<telerik:RadComboBox
x:Name="CustomComboBox"
Height="5"
Margin="0,2"
ItemsSource="{Binding DataContext.CustomFilterValues, RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
SelectedValue="{Binding Filter1.Value}"
Text="{Binding Filter1.Value, UpdateSourceTrigger=PropertyChanged}">
<telerik:RadComboBox.Style>
<Style BasedOn="{StaticResource {x:Type telerik:RadComboBox}}" TargetType="{x:Type telerik:RadComboBox}">
<Setter Property="Visibility" Value="Collapsed" />
<Style.Triggers>
<DataTrigger Binding="{Binding DataContext.FilterType, RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}, Mode=OneWay, UpdateSourceTrigger=PropertyChanged, FallbackValue=Collapsed}" Value="Condition">
<Setter Property="Visibility" Value="Visible" />
</DataTrigger>
</Style.Triggers>
</Style>
</telerik:RadComboBox.Style>
</telerik:RadComboBox>
<!--</StackPanel>-->
</StackPanel>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Button
x:Name="PART_ApplyFilterButton"
Grid.Column="0"
Margin="0,2,2,2"
telerik:LocalizationManager.ResourceKey="GridViewFilter" />
<Button
x:Name="PART_ClearFilterButton"
Grid.Column="1"
Margin="2,2,0,2"
telerik:LocalizationManager.ResourceKey="GridViewClearFilter" />
</Grid>
</StackPanel>
</Border>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>