954,593 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

how to bind image control in datagrid using wpf

Hi,

I am trying to bind a datagrid with a datatable in WPF. This is my first project in WPF. The datatable has a single column. The datatable is bound with a table that has a varbinary image column in database.
In database, this is the table structure
table tblPicture
(
@Picture varbinary(MAX)
)

it has 5 rows.

Datagrid gets filled with 5 rows (of datatype byte[]). But all the 5 rows are empty.

1) When page loads, the following code is executed:

public MainWindow()
{
InitializeComponent();
Myclass cs = new Myclass ();
DataTable dt = cs.Method1();
this.dataGrid1.DataContext = dt;
}

2) The datagrid xaml code:

.CellTemplate>
.Columns>

3) I have created this resource:

.Resources>

dhanlak
Newbie Poster
4 posts since Dec 2011
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: