---
title: "How to bind the local image in datagrid using wpf?"  
description: "How to bind the local image in datagrid using wpf?"  
author: "marcel ethan"  
published: 2013-08-08  
updated: 2013-08-09  
canonical: https://www.mindstick.com/forum/1361/how-to-bind-the-local-image-in-datagrid-using-wpf  
category: "wpf"  
tags: ["wpf"]  
reading_time: 2 minutes  

---

# How to bind the local image in datagrid using wpf?

I have a datagrid in [wpf](https://www.mindstick.com/forum/304/wpf) and I want to show an [image](https://www.mindstick.com/articles/23551/an-investigate-distinctive-seafood-restaurant-for-your-image-stamp-character) in image column. How to do the [task](https://www.mindstick.com/forum/161761/what-is-the-difference-between-task-and-thread)?

Please provide a [demo](https://www.mindstick.com/forum/157370/how-to-swap-neighbor-characters-in-string-e-g-string-demo-would-be-edom) if possible.

Any help will be appreciated.

## Replies

### Reply by shreesh chandra shukla

Hi!You can use the below lines of code to show an image in image column of datagrid.In window.xaml code :-

```
        <DataGrid AutoGenerateColumns="False" Margin="12" Name="dataGrid1">            <DataGrid.Columns>                <DataGridTemplateColumn>                    <DataGridTemplateColumn.CellTemplate>                        <DataTemplate>                            <Image Source="{Binding ImageFilePath}" Width="50" Height="50" />                        </DataTemplate>                    </DataGridTemplateColumn.CellTemplate>                </DataGridTemplateColumn>            </DataGrid.Columns>        </DataGrid>In window.xaml.cs code :-public class imageBinding        {            public BitmapImage ImageFilePath { get; set; }        }        private void Window_Loaded(object sender, RoutedEventArgs e)        {            for (int i = 0; i <= 20; i++)            {                dataGrid1.Items.Add(new imageBinding { ImageFilePath = new BitmapImage(new Uri(@"Physical Image File Path           	")) });            }        }
```

thanks!\


---

Original Source: https://www.mindstick.com/forum/1361/how-to-bind-the-local-image-in-datagrid-using-wpf

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
