Telerik Forums
UI for WPF Forum
0 answers
27 views

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

Jason
Top achievements
Rank 1
 asked on 05 Mar 2025
1 answer
42 views

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

Martin Ivanov
Telerik team
 answered on 30 Jan 2025
1 answer
82 views

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.

Martin Ivanov
Telerik team
 answered on 09 Oct 2024
1 answer
41 views

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

Martin Ivanov
Telerik team
 answered on 07 Oct 2024
1 answer
79 views

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 

Mihai Adrian
Top achievements
Rank 1
Iron
 answered on 04 Jun 2024
1 answer
83 views

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}`?

Martin Ivanov
Telerik team
 answered on 11 Mar 2024
1 answer
89 views

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

Dimitar
Telerik team
 answered on 08 Feb 2024
1 answer
64 views

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

Martin Ivanov
Telerik team
 answered on 04 Jan 2024
1 answer
109 views
I am using filtering with a custom DataProvider for my Virtual Grid.   Users use the popup dialog to set filter conditions.  It works well. 

I understand how to retrieve the filter descriptors from one grid and to apply them to another.  But how may I persist them?

I want to save to a text file a set of filters from VirtualGrid A.   Then, later on, I wan to  set VirtualGrid B columns to to use those same filters purely from that persisted text? 


I can see that ColumnFilterDescriptor.ToString() will give me what looks like a full  persistable filter expression.  At least it looks like a meaningful expression.  But I canntot see a method to go the other way
Dimitar
Telerik team
 answered on 14 Nov 2023
1 answer
95 views
I need a way to determine that the user has applied a column filter in the VirtualGrid control so I can update another control in my UI. Is there a way to determine when a filter has been applied or cleared?
Martin Ivanov
Telerik team
 answered on 09 Oct 2023
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?