GridViewImageColumn filter with image

5 posts, 1 answers
  1. Hakki
    Hakki avatar
    47 posts
    Member since:
    Sep 2012

    Posted 01 Nov 2012 Link to this post

    Hey guys,

    I have GridViewImageColumn and when I filter it, the filter lists the images by their location (i.e: images/image.png). How do I make it so when filtering a image column, instead of listing the location it lists the images themselves?

    Thanks a lot.
  2. Answer
    Rossen Hristov
    Rossen Hristov avatar
    2478 posts

    Posted 01 Nov 2012 Link to this post


    While this cannot be supported out-of-the-box, you can check this sample project and customize it according to your needs.

    All the best,
    Rossen Hristov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. Hakki
    Hakki avatar
    47 posts
    Member since:
    Sep 2012

    Posted 01 Nov 2012 Link to this post


    Very cool and simple. Worked like a charm. Thanks a lot!

    I am sometimes in a situation where I can't download demo projects so if anyone gets here from google under same circumstance, this is the class you need (from the project above):

    public class ImageFilterColumn : GridViewImageColumn
        /// <summary>
        /// Gets the filtering display function.
        /// </summary>
        /// <value>The filtering display function.</value>
        /// <remarks>This function is used by the filtering control distinct values list.
        /// It accepts a raw data value and returns what will become the content of the
        /// distinct value checkbox.</remarks>
        protected override Func<object, object> FilteringDisplayFunc
            get { return ImageFilterColumn.ConvertUriStringToImage; }
        public static object ConvertUriStringToImage(object uriString)
            var image = new Image();
            image.Source = new BitmapImage(new Uri(uriString.ToString(), UriKind.Relative));
            return image;

    And then make a column of that class:
    <my:ImageFilterColumn DataMemberBinding="{Binding Image}" ShowFieldFilters="False" />
  4. Asaf
    Asaf avatar
    1 posts
    Member since:
    Jul 2016

    Posted 12 Jul 2016 in reply to Hakki Link to this post

    It works wonderfull except case the Binding member is boolean data which converted to image by Converter function.

    Do You have any good additional to solve it?

  5. Stefan Nenchev
    Stefan Nenchev avatar
    498 posts

    Posted 15 Jul 2016 Link to this post

    Hello Asaf,

    I am not sure of the exact setup at your end but I have updated the sample project with a possible approach. Please review it and update the thread whether the information was useful.

    Stefan Nenchev
    Telerik by Progress
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Back to Top