A list is to be displayed using the RadTreeListView. It should be possible to add a single element or to delete several selected elements. As soon as a new element is added, all other elements should be deselected and the new element should be selected.
The problem is that if a certain number of elements is deleted, afterwards just as many newly added elements are automatically deselected, although they were previously explicitly selected programmatically.
Example with test application
Initial state:
→ Click "Add" to add a new element:
→ Click "Delete" to delete selected element (for simplicity the automatically selected element just added is used):
→ Click "Add" to add a new element:
Element 4 should now be selected.
→ Click "Add" to add a new element:
Now it works again as expected.
The same behavior can be replicated with deleting multiple elements. Afterwards, exactly this number of then newly added elements are deselected, although they should be selected. After that the behavior is as expected again.
View
<StackPanel>
<Button Click="Add_Button_Click">Add</Button>
<Button Click="Delete_Button_Click">Delete</Button>
<telerik:RadTreeListView ItemsSource="{Binding VM.Elements}"
SelectionMode="Multiple"
IsSynchronizedWithCurrentItem="False"
RowIndicatorVisibility="Collapsed"
>
<telerik:RadTreeListView.RowStyle>
<Style TargetType="{x:Type telerik:TreeListViewRow}">
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}"/>
</Style>
</telerik:RadTreeListView.RowStyle>
</telerik:RadTreeListView>
</StackPanel>
CodeBehind
public partial class MainWindow : Window
{
public ViewModel VM { get; set; }
public MainWindow()
{
InitializeComponent();
VM = new ViewModel();
DataContext = this;
}
private void Add_Button_Click(object sender, RoutedEventArgs e)
{
VM.AddNewData();
}
private void Delete_Button_Click(object sender, RoutedEventArgs e)
{
VM.Elements.RemoveAll(x => x.IsSelected);
}
}
ViewModel
public class ViewModel
{
public ObservableCollection<Data> Elements { get; set; } = new ObservableCollection<Data>();
public ViewModel()
{
Enumerable.Range(0, 3).ForEach(_ => AddNewData());
Elements.CollectionChanged += Data_CollectionChanged;
}
public void AddNewData()
{
Elements.Add(new Data());
}
private void Data_CollectionChanged(object? sender, NotifyCollectionChangedEventArgs e)
{
if (e.Action == NotifyCollectionChangedAction.Add)
{
Elements.ForEach(x => x.IsSelected = false);
e.NewItems?.OfType<Data>().ForEach(x => x.IsSelected = true);
}
}
public class Data : INotifyPropertyChanged
{
static private int counter = 0;
public event PropertyChangedEventHandler? PropertyChanged;
private bool isSelected = false;
public bool IsSelected
{
get
{
return isSelected;
}
set
{
isSelected = value;
OnPropertyChanged(nameof(IsSelected));
}
}
public int Id { get; set; } = counter++;
protected void OnPropertyChanged(string propertyName)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
}Hi,
Im using conversationalUI in a WPF app and would like to update the message in realtime as my openAI response is streaming in to make the UX a better experience on long responses. This should update the message being displayed in realtime as the service is streaming in text.
I only see the ability to do a message.Add() option, I feel like there should also be a AddAsync() method. Is this even possible in this control?
Thanks in advance!

If I have subscribed to the RadCarouselPanel.SelectedIsTopItem event, should I not get notifications when that property changes to false?
In my case, when the user scrolls the mouse wheel over the control or hits the little left/right buttons at the bottom of the carousel, the selected item certainly moves off of the top. But the event is never fired. It is only fired when I left click on the item to make the control force it to the top.
To illustrate, here is how I find the panel and subscribe to the events
var panel = this.Carousel.FindChildByType<RadCarouselPanel>();
panel.IsAnimatingChanged += Panel_IsAnimatingChanged;
panel.SelectedIsTopItem += Panel_SelectedIsTopItem;
I then have debug log lines in the two handler functions to let me know when the events fire.
private void Panel_SelectedIsTopItem(object sender, RoutedEventArgs e)
{
var panel = (RadCarouselPanel)sender;
Log.Debug($"Panel SelectedIsTopItem changed to {panel.IsSelectedTopItem}");
}
private void Panel_IsAnimatingChanged(object sender, RoutedEventArgs e)
{
var panel = (RadCarouselPanel)sender;
Log.Debug($"Panel is animating changed to {panel.IsAnimating}");
}When I bring up my display the selected item is at the top by default
Then I use the mouse wheel or the scroll buttons to move the panel items without changing the selected item. Note that the blue "selected" rectangle still appears around #002 to the left even though it is not #003 that is topmost
But all I get in my log is IsAnimatingChanged events
15:31:50.690 [ 1] DEBUG - Panel_IsAnimatingChanged: Panel is animating changed to True
15:31:50.977 [ 1] DEBUG - Panel_IsAnimatingChanged: Panel is animating changed to False
But now if I left-click the new topmost item (#003), then it becomes selected
and I am notified that SelectedIsTopMost has changed, along with an event about IsAnimating changed even though no animation occurs in this instance
15:36:16.447 [ 1] DEBUG - Panel_IsAnimatingChanged: Panel is animating changed to True
15:36:16.725 [ 1] DEBUG - Panel_SelectedIsTopItem: Panel SelectedIsTopItem changed to True
15:36:16.730 [ 1] DEBUG - Panel_IsAnimatingChanged: Panel is animating changed to False
In order for the event SelectedIsTopMost to be useful to me, I have to be notified about it when it becomes false. Why am I not being told this?
For sake of completeness, here is my XAML
<tk:RadCarousel x:Name="Carousel"
Padding="0" Margin="0"
Grid.Row="1"
ItemsSource="{Binding ScansView}"
VerticalContentAlignment="Top"
IsVisibleChanged="Carousel_OnIsVisibleChanged"
HorizontalAlignment="{Binding HorizontalAlignment}" VerticalAlignment="{Binding VerticalAlignment}"
>

I have the following XAML
<Window x:Class="WpfApp46.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfApp46"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="1200"
DataContext="{Binding RelativeSource={RelativeSource Self}}">
<Grid>
<telerik:RadGridView ItemsSource="{Binding Foos}" AutoGenerateColumns="False">
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn DataMemberBinding="{Binding Foo1}" MinWidth="100" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding Foo2}" MinWidth="100" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding Foo3}" Width="*" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding Foo4}" MinWidth="100" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding Foo5}" MinWidth="100" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding Foo6}" MinWidth="100" />
</telerik:RadGridView.Columns>
</telerik:RadGridView>
</Grid>
</Window>
and the following code behind
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace WpfApp46
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public List<Foo> Foos { get; set; }
public MainWindow()
{
Foos = new List<Foo>()
{
new Foo() { Foo1 = "Foo 1", Foo2 = "Foo 2", Foo3 = "Foo 3", Foo4 = "Foo 4", Foo5 = "Foo 5", Foo6 = "Foo 6" },
new Foo() { Foo1 = "Foo 1", Foo2 = "Foo 2", Foo3 = "Foo 3", Foo4 = "Foo 4", Foo5 = "Foo 5", Foo6 = "Foo 6" },
new Foo() { Foo1 = "Foo 1", Foo2 = "Foo 2", Foo3 = "Foo 3", Foo4 = "Foo 4", Foo5 = "Foo 5", Foo6 = "Foo 6" },
new Foo() { Foo1 = "Foo 1", Foo2 = "Foo 2", Foo3 = "Foo 3", Foo4 = "Foo 4", Foo5 = "Foo 5", Foo6 = "Foo 6" },
new Foo() { Foo1 = "Foo 1", Foo2 = "Foo 2", Foo3 = "Foo 3", Foo4 = "Foo 4", Foo5 = "Foo 5", Foo6 = "Foo 6" },
new Foo() { Foo1 = "Foo 1", Foo2 = "Foo 2", Foo3 = "Foo 3", Foo4 = "Foo 4", Foo5 = "Foo 5", Foo6 = "Foo 6" },
new Foo() { Foo1 = "Foo 1", Foo2 = "Foo 2", Foo3 = "Foo 3", Foo4 = "Foo 4", Foo5 = "Foo 5", Foo6 = "Foo 6" },
new Foo() { Foo1 = "Foo 1", Foo2 = "Foo 2", Foo3 = "Foo 3", Foo4 = "Foo 4", Foo5 = "Foo 5", Foo6 = "Foo 6" },
};
InitializeComponent();
}
}
public class Foo
{
public string Foo1 { get; set; }
public string Foo2 { get; set; }
public string Foo3 { get; set; }
public string Foo4 { get; set; }
public string Foo5 { get; set; }
public string Foo6 { get; set; }
}
}

Hello.
I have the same situation as https://www.telerik.com/forums/virtual-page-count.
Since the database has over 100 million data, I don't want to bring all the data into memory.
When a user clicks on a specific page, I'm trying to get only the data in that range from the DBMS.
I also read about Unbound Mode (https://docs.telerik.com/devtools/wpf/controls/raddatapager/features/unbound-mode)
But this seems to use code-behind.
I don't want to write a code-behind because I use the MVVM pattern.
How can I do it?
The code below has been simplified.
1. DataView.xaml
<UserControl x:Class="MyProject.Views.MyDataView"
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:local="clr-namespace:MyProject.Views"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
xmlns:behaviors="http://schemas.microsoft.com/xaml/behaviors"
mc:Ignorable="d"
d:DesignHeight="550" d:DesignWidth="1920">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="26" />
<RowDefinition Height="400"/>
<RowDefinition Height="28" />
</Grid.RowDefinitions>
<Grid Grid.Row="0" HorizontalAlignment="Right">
<StackPanel Orientation="Horizontal">
<TextBlock Text="Page Size" Margin="2 8 12 2" FontWeight="SemiBold"/>
<telerik:RadComboBox
Height="22"
Margin="0 0 10 0"
FontFamily="Segoe UI"
ClearSelectionButtonVisibility="Visible"
ClearSelectionButtonContent="Show all"
DisplayMemberPath="DisplaySize"
ItemsSource="{Binding MyDataPageSize}"
SelectedItem="{Binding SelectedMyDataPageSize}"
AllowMultipleSelection="False"
Command="{Binding RefreshMyDataCommand}"/>
</StackPanel>
</Grid>
<telerik:RadGridView x:Name="MyDataGridView"
Grid.Row="1"
IsFilteringAllowed="False"
AutoGenerateColumns="False"
ShowGroupPanel="False"
CanUserFreezeColumns="False"
RowIndicatorVisibility="Collapsed"
SelectionMode="Extended"
TextBlock.TextAlignment="Center"
CanUserSortColumns="False"
IsReadOnly="True"
Margin="10 5 10 0"
ScrollMode="RealTime"
ItemsSource="{Binding DynamicGridViewItemSource}"
</telerik:RadGridView>
<telerik:RadDataPager Grid.Row="2"
x:Name="MyDataPager"
Width="{Binding ElementName=MyDataGridView, Path=ActualWidth}"
PageSize="{Binding SelectedMyDataPageSize.Size}"
Source="{Binding Items, ElementName=MyDataGridView}"
ItemCount="{Binding TotalItemCount}"
BorderThickness="1,0,1,1"
DisplayMode="All"
AutoEllipsisMode="Both"
NumericButtonCount="10"
IsTotalItemCountFixed="False" >
<behaviors:Interaction.Triggers>
<behaviors:EventTrigger EventName="PageIndexChanged">
<behaviors:InvokeCommandAction Command="{Binding PageIndexChangedCommand}"
CommandParameter="{Binding ElementName=MyDataPager, Path=PageIndex}" />
</behaviors:EventTrigger>
</behaviors:Interaction.Triggers>
</telerik:RadDataPager>
</Grid>
</UserControl>
2. DataViewModel.cs
namespace MyProject.ViewModels
{
public class StageDTO
{
public string StartNumber { get; set; }
public string EndNumber { get; set; }
}
public class MyDataViewModel : ViewModelBase
{
// some code
private int _totalItemCount;
public int TotalItemCount
{
get
{
return _totalItemCount;
}
set
{
_totalItemCount = value;
OnPropertyChanged(nameof(TotalItemCount));
}
}
public MyDataViewModel(CyclerMode mode)
{
// do something
}
public void ShowMyDataOfSelectedStage(object parameter)
{
StageDTO dto = parameter as StageDTO;
// do something
// and i calculate TotalItemCount here
TotalItemCount = Convert.ToInt32(dto.EndNumber) - Convert.ToInt32(dto.StartNumber);
}
}
}
There may have been a typo in the process of simplifying, but there is no problem when i actually run the program.
TotalItemCount = Convert.ToInt32(dto.EndNumber) - Convert.ToInt32(dto.StartNumber);
The data goes in correctly in the code above, but nothing changes.
I made the changes below, but it still doesn't work.
ItemCount="{Binding TotalItemCount, UpdateSourceTrigger=PropertyChanged}"
If I change it like below
ItemCount="{Binding TotalItemCount, Mode=TwoWay}"
I am getting an exception like below.
System.InvalidOperationException: 'Setting RadDataPager.ItemCount is allowed in Unbound Mode only.'
How do I get it to work like I want?

I have a RadMultiColumnComboBox with AutoCompleteMode="Search". If I type "asdf" into the combo box, close the dropdown without actually selecting an item, and then refresh the page I want to clear "asdf", but I cannot figure out how to clear this text. I have tried setting the selected Item to null, setting AutoCompleteProvider.SearchText to an empty string, and setting the selected index to -1.
What am I doing wrong?

Hi,
I would like to create a docking layout with 4 controls spread over 2 rows as in the attached image. I achieved this result using compass, but I need to create the same layout by design.
Thank you
Luigi
Hi. I have some question.
An exception occurred while debugging the ExecutiveDashboard demo source code.
exception text :
System.InvalidOperationException: 'An error occurred while processing this request.'
DataServiceTransportException: The request was aborted: Could not create SSL/TLS secure channel.
WebException: The request was aborted: Could not create SSL/TLS secure channel.
An error occurred while downloading and installing the ExecutiveDashboard demo app(setup.exe).
install.log :
The following properties have been set:
Property: [AdminUser] = true {boolean}
Property: [InstallMode] = HomeSite {string}
Property: [NTProductType] = 1 {int}
Property: [ProcessorArchitecture] = AMD64 {string}
Property: [VersionNT] = 10.0.0 {version}
Running checks for package '.NET Desktop Runtime 6.0.1 (x64)', phase BuildList
Checking conditions before installer checks for command 'net6desktopruntime_x64\windowsdesktop-runtime-6.0.1-win-x64.exe'
Result of running operator 'ValueNotEqualTo' on property 'ProcessorArchitecture' and value 'AMD64': false
Result of checking conditions before installer checks for command 'net6desktopruntime_x64\windowsdesktop-runtime-6.0.1-win-x64.exe' is: No action
Running external check with command 'C:\Users\jmkim\AppData\Local\Temp\VSD29A9.tmp\net6desktopruntime_x64\NetCoreCheck.exe' and parameters 'Microsoft.WindowsDesktop.App 6.0.1'
Process exited with code 0
Setting value '0 {int}' for property 'NetCoreCheck'
The following properties have been set for package '.NET Desktop Runtime 6.0.1 (x64)':
Property: [NetCoreCheck] = 0 {int}
Running checks for command 'net6desktopruntime_x64\windowsdesktop-runtime-6.0.1-win-x64.exe'
Result of running operator 'ValueNotEqualTo' on property 'ProcessorArchitecture' and value 'AMD64': false
Result of running operator 'VersionLessThan' on property 'VersionNT' and value '6.1.0': false
Result of running operator 'ValueEqualTo' on property 'NetCoreCheck' and value '0': true
Result of checks for command 'net6desktopruntime_x64\windowsdesktop-runtime-6.0.1-win-x64.exe' is 'Bypass'
'.NET Desktop Runtime 6.0.1 (x64)' RunCheck result: No Install Needed
Launching Application.
URLDownloadToCacheFile failed with HRESULT '-2146697208'
Error: An error occurred trying to download 'http://demos.telerik.com/wpf/executivedashboard/ExecutiveDashboard.application'.
The same problem occurred with the SalesDashboard demo source code and app.
What caused the problem?

Hello!
I need to make a custom separate scrollbar for RadGridView.
Please tell me how can I know if some of the rows of the RadGridView are already out of area of visibility and how can I find out what part of the rows is visible and position of the part of the rows?
Hi,
I was not able to find this answer on the forum. It looks like a simple thing to do but I was not able to understand it.
I have three RadTreeView with the following xaml options: (IsDragDropEnabled="True" AllowDrop="True" telerik:ScrollingSettingsBehavior.IsEnabled="False" IsDragTooltipEnabled="False") . All three Trees have 2 level of data of 2 different type of objects.
The drop of an item might be allowed or not, depending on a combination on:
As an example, the level 2 objects of tree 1 cannot be dropped on tree 3, while on tree 2 the can only be dropped inside the level 1, or before/after the level 2 (not inside level 2).
I implemented all the controls to allow this behaviour in the handler of "DragDropManager.AddDropHandler", in which when the drop is not allowed I simply have that the DropAction = DropAction.None and everything is working fine.
However what I would like to have is that when the drop is not supposed to be allowed, the drop preview should not be visible. by drop preview I mean the line in between items when the drop position is after/before or the highlight of the target item when the drop position is inside. Note that I still would like to keep the drag preview of the source item, and that I disabled the dragtooltip as not of interest.
I considered using the handler "DragDropManager.AddDragInitializeHandler" to set the AllowDrop to false for all the correct items, however sometimes (like in the example above) I want to disable the drop only for certain drop positions, thus the item AllowDrop property cannot be set to false at the beginning of the drag.
What I think I should do is to use the handler "DragDropManager.AddDragOverHandler", in which I check if the drop is feasible. If it is not, I somehow disable the drop preview, if it is allowed, i enable it once again. This is where I'm stuck.
Considering the variable var options = DragDropPayloadManager.GetDataFromObject(e.Data, TreeViewDragDropOptions.Key) as TreeViewDragDropOptions;
If after checking that the drop is not allowed I set options.DropTargetItem.AllowDrop = false, the visual result is exactly what I need. However, from that moment on the handler "DragDropManager.AddDragOverHandler" does not fire anymore on that Item, so I cannot set it again to true.
If instead I set options.DropTargetItem.IsDropAllowed = false; nothing happens.
I tried to play with the dragvisual property, setting as an example the dragVisual.IsDropPossible = false, but it doesn't change the result (I guess that this property is only for the dragtooltip that I disabled)
Note that, if possible, I also do not want to override the drop position from the not allowed to the allowed one, like suggested in the documentation (https://docs.telerik.com/devtools/wpf/controls/radtreeview/how-to/drag-and-drop/enabled-drop-inside-only).
Could you please suggest me how to proceed? Please let me know if you need more information.
Thanks in advance for your help.