Hi,
We recently upgraded from 2022.3.912 to 2025.1.211 and it appears that VirtualGrid HeaderSizeNeeded is no longer called after we change VirtualGrid ColumnWidth to flush the cache of column widths. Is this a bug or is there some other way we should be forcing a recalculation of the column widths? Thanks in advance.
__Jason
Hi,
How can I control the background colour of the extended bit of the header in a RadVirtualGrid? See the area circled in red on the screenshot.
Thanks in advance,
__Jason
I ran into this problem when experimenting with VirtualGrid, but trying to work with Multiple selection mode seems completely broken. I have even created a new project from scratch and only imported the following packages:
telerik.windows.controls.for.wpf.xaml (2024.3.924)
telerik.windows.controls.virtualgrid.for.wpf.xaml (2024.3.924)
My MainWindow.xaml looks like:
<Window x:Class="TestVirtGrid.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:TestVirtGrid"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="50"/>
</Grid.RowDefinitions>
<telerik:RadVirtualGrid x:Name="VirtGrid" CanUserEdit="False" Grid.Row="0" SelectionMode="Multiple" SelectionUnit="Row" />
<Button Grid.Row ="1" Content="amon"/>
</Grid>
</Window>
The code-behind looks like:
using System.Collections.ObjectModel;
using System.Text;
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;
using Telerik.Windows.Controls.VirtualGrid;
namespace TestVirtGrid
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
ObservableCollection<Test> list = [];
for (int i = 0; i < 20; i++)
list.Add(new Test() { a = i, b = i });
VirtGrid.DataProvider = new DataProvider(list);
}
}
public class Test
{
public int a { get; set; }
public int b { get; set; }
}
}
When running the application, I'm able to select rows, but deselecting is clearly not working as intended. When I try to deselect, it often just completely fails to do so. Sometimes (like, 1 in 5 tries?) it does end up deselecting the row.
If there's something I've done wrong here, please let me know, otherwise I'd like to get some confirmation that this module doesn't work.
Our application has a RadVirtualGrid that can be much wider than the window (so it scrolls). Our SelectionUnit is set to "Row". But when I hit Ctrl + End the grid not only jumps to the last row, but also scrolls the last column into view. It seems to me that if the SelectionUnit is "Row" the control should just jump to the last row and not change the column or scroll status at all. I guess the same thing is true about ctrl+Home to go to the top. Anyone agree?
Thanks!
Nathan
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
I've read this thread but it is a bit confusing and old: Live sorting/grouping in UI for WPF | Telerik Forums
What is the current situation?
I am having problems with Devexpress GridControl as they dont support what they call "Live Data Shaping" eg sorting with real-time updates IF you use WPF binding.
Question - can Telerik data grid and/or virtual grid do live data shaping where columns use custom templates with WPF binding to a dictionary. For example: `{Binding Fields[abc].Value}`?
Hello,
I found row-height setting API in WinForms, like Resizing Rows Programmatically- RadVirtualGrid - Telerik UI for WinForms .
But can't find it for WPF. I can make rows resizable by a user but can't do it programatically.
What I'd like to do is to control row height per cell content height.
Thanks.
Hanjo
Hello! I'm interested in the VirtualGrid control for WPF, since the demo looks very fast for very large data sets. For our application, we want to show a column group header, to indicate that a set of columns are related to each other. In this dummy example, the data for four people is displayed. We'd like to indicate that there were four groups of results for each person, and have the results displayed under each group like so:
Ideally, the Row header (the name of each person), the Column headers and the Column Group headers should be fixed, so the user can scroll the rows and columns at will, but still see the headers. We would also like to be able to capture mouse inputs when the user clicks on a column or row header or the group header, if possible.
Is something like this possible using the control?
Thanks,
Ed