Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

How to set datatable items into wpf datagrid cells ?

$
0
0

Hi,

   In my application i have one datagrid with binding fields like below screenshot.

and i have one datatable  with data from database.

now i want to bind above 2 datatable items to datagrid into a specific cells.

for this i tried blow code

((ProductDetails)dgvitemdetails.Items[0]).pitemCode = dtProdItems.Rows[0]["PROD_CODE"].ToString();

but i am getting below error

"Operation is not valid while ItemCollection has no inner collection. ItemCollection is uninitialized or binding on ItemsControl. ItemSource supplied null for collection."

Please guide me where i did the mistake.


Thanking You, Nagendra.


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>