Hello,
I'm trying to implement GIF for my GridView but it isn't animated. Does GridView support GIFs?
My example:
<Window
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:NotWorkingGif"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" x:Class="NotWorkingGif.MainWindow"
mc:Ignorable="d"
DataContext="{Binding RelativeSource={RelativeSource Self}}"
Title="MainWindow" Height="450" Width="800">
<Grid>
<telerik:RadGridView ItemsSource="{Binding Collection}" AutoGenerateColumns="False">
<telerik:RadGridView.Columns>
<telerik:GridViewImageColumn DataMemberBinding="{Binding ImageUri}" Header="" ImageStretch="None" ImageHeight="16" ImageWidth="16" />
</telerik:RadGridView.Columns>
</telerik:RadGridView>
</Grid>
</Window>
namespace NotWorkingGif
{
using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Windows;
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public ObservableCollection<TestClass> Collection { get; set; } = new ObservableCollection<TestClass>();
public MainWindow()
{
InitializeComponent();
this.Collection.Add(new TestClass() { ImageUri = new Uri(@"path to GIF image") });
}
}
public class TestClass : INotifyPropertyChanged
{
private Uri imageUri;
public Uri ImageUri
{
get => imageUri;
set
{
imageUri = value;
this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("ImageUri"));
}
}
public event PropertyChangedEventHandler PropertyChanged;
}
}