---
title: "How I can bind datatable to LISTBOX in wpf?"  
description: "How I can bind datatable to LISTBOX in wpf?"  
author: "Kate Smith"  
published: 2013-07-18  
updated: 2013-07-18  
canonical: https://www.mindstick.com/forum/1310/how-i-can-bind-datatable-to-listbox-in-wpf  
category: "wpf"  
tags: ["wpf"]  
reading_time: 1 minute  

---

# How I can bind datatable to LISTBOX in wpf?

Hi Experts!

How can I bind [datatable](https://www.mindstick.com/blog/195/datatable-in-ado-dot-net) to a [ListBox](https://www.mindstick.com/articles/626/listbox-events-in-c-dot-net) and [select](https://www.mindstick.com/forum/160534/orderby-then-select-vs-select-then-orderby-performance) a [field](https://www.mindstick.com/forum/160867/does-mindstick-provide-training-for-field-marketing) which I want to display in the ListBox in WPF.

Thank in addvance

## Replies

### Reply by shreesh chandra shukla

Solution!

Here is a pure XAML solution :

```
<DockPanel DataContext="{StaticResource myDataViewSource}">   
<ComboBox DockPanel.Dock="Bottom" x:Name="FieldSelector" SelectedIndex="0">        <ComboBoxItem Content="Field1" Tag="Field1"/>        <ComboBoxItem Content="Field2" Tag="Field2"/>        <ComboBoxItem Content="Field3" Tag="Field3"/>        <ComboBoxItem Content="Field4" Tag="Field4"/>   
</ComboBox>   
<ListBox ItemsSource="{Binding}"             DisplayMemberPath="{Binding ElementName=FieldSelector,Path=SelectedItem.Tag}"
/></DockPanel>
```


---

Original Source: https://www.mindstick.com/forum/1310/how-i-can-bind-datatable-to-listbox-in-wpf

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
