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>