Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4067960
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T16:18:55+00:00 2026-05-20T16:18:55+00:00

Im trying to bind an image to an Id in a grid where I

  • 0

Im trying to bind an image to an Id in a grid where I show all my users. Does anybody knows how to do this?
I’ve got a table User where there is a field called StatusId.

There are 2 kinds of status

Status1: Id:10 | active
Status2: Id:90 | Non-active

When the status is 10 I want to show a green cross, when it’s 90 I want to show Red cross.

I’m working with the Mvvm pattern.

Here is my gridcode.

<telerik:RadGridView Name="RadGridView1" ItemsSource="{Binding CovrUsers,Mode=TwoWay}" IsReadOnly="True" DataContext="{Binding Source={StaticResource CovrUsersViewModel}}" AutoGenerateColumns="False" Margin="230 0 0 0 " Height="Auto">
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn Header="First name" DataMemberBinding="{Binding FirstName}" />
                <telerik:GridViewDataColumn Header="Last name" DataMemberBinding="{Binding LastName}" />
                <telerik:GridViewDataColumn Header="User name" DataMemberBinding="{Binding UserName}" />
                <telerik:GridViewDataColumn Header="Hourly rate" DataMemberBinding="{Binding HourlyRate}" />
                <telerik:GridViewDataColumn Header="Rights" DataMemberBinding="{Binding Rights.Description}"  />
                <telerik:GridViewDataColumn Header="Status" DataMemberBinding="{Binding StatusId}" />

            </telerik:RadGridView.Columns>
        </telerik:RadGridView>
        <telerik:RadDataPager x:Name="RadDataPager1" Source="{Binding CovrUsers, ElementName=FirstName}" DisplayMode="All" IsTotalItemCountFixed="True" Margin="230,0,0,0" VerticalAlignment="Bottom" FontSize="11" />

thx for the help 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T16:18:56+00:00Added an answer on May 20, 2026 at 4:18 pm

    You’ll want to use a ValueConverter to convert your Status value into an image. Something like this:

    public class CommentTypeIconConverter : IValueConverter
        {
            public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
            {
                if(value != null)
                {
                    int ct = int.Parse(value.ToString());
                    if(ct == 10)
                    {
                        StreamResourceInfo sr = Application.GetResourceStream(
                            new Uri("Assets/greencross.png", UriKind.Relative));
                        BitmapImage bmp = new BitmapImage();
                        bmp.SetSource(sr.Stream);
    
                        return bmp;
                    }
                    else
                    {
                        StreamResourceInfo sr = Application.GetResourceStream(
                        new Uri("Assets/redcross.png", UriKind.Relative));
                        BitmapImage bmp = new BitmapImage();
                        bmp.SetSource(sr.Stream);
    
                        return bmp;
                    }
                }
                else
                {
                    StreamResourceInfo sr = Application.GetResourceStream(
                        new Uri("Assets/empty.png", UriKind.Relative));
                    BitmapImage bmp = new BitmapImage();
                    bmp.SetSource(sr.Stream);
    
                    return bmp;
                }
            }
    
            public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
            {
                throw new NotImplementedException();
            }
        }
    

    Read this link to learn about how to use the value converter on your page.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to bind an image that is saved in isolated storage and
I'm writing a WPF application and trying to bind an image to my view
I'm trying to bind a list of custom objects to a WPF Image like
When i use one jpeg image with this web-server its very slow to show
I'm trying to bind an image's source to a string in a listbox with
I'm trying to bind a matching name and image into a Hub Tile. the
Im trying to bind a list of images to a Listbox, but all I
I'm trying to databind a list of image thumbnails in a grid fashion. In
I am trying to retrieve the image from resource file and tryin to bind
I am trying to model the layout that is displayed in this image .

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.