WPF MVVM DataGrid Bind from SQL Database 01

WPF MVVM DataGrid Bind from SQL Database

Let’s see how we can Bind WPF DataGrid from SQL Database using MVVM methodology. WPF MVVM DataGrid Bind from SQL Database. In this particular example, a WPF DataGrid is filled from SQL Database table named “tblCountries”, using WPF ObservableCollection ( from ViewModel). My SQL table : tblCountries  Make a WPF DataGrid as below in your Form : […]

Read More

WPF Listbox Binding from MS SQL Database 02

WPF MVVM Listbox SelectionChanged Get SelectedItem

Let’s see how we can get SelectedItem from a WPF Listbox using MVVM methodology. WPF MVVM Listbox SelectionChanged Get SelectedItem. In this example, I will be binding the WPF Listbox from MS SQL Database using MVVM ViewModel and ObservableCollection. The logic is quite simple. I’m passing a class item to ViewModel of type from which ListBox is […]

Read More

WPF Listbox Binding from MS SQL Database 02

WPF MVVM Listbox Binding from SQL Database

Let’s see how we can bind WPF Listbox from SQL Database using MVVM methodology . WPF MVVM Listbox Binding from SQL Database. In this example, we will Bind a WPF Listbox using ObservableCollection from WPF ViewModel. Data is fetched from MS SQL Database table : tblCountries To see How you can fetch data from MS SQL Database and bind […]

Read More

WPF Listbox Binding from MS SQL Database 02

WPF Listbox SelectionChanged – Get SelectedItem

Let’s see how we can get WPF Listbox SelectedItem and use it for displaying in a WPF Messagebox. To see How to Bind WPF Listbox from Database please visit this Post. WPF Listbox SelectionChanged – Get SelectedItem Make a simple Listbox in your WPF form as below : MainWindow.xaml: <Window x:Class=”WpfApplication2.MainWindow” xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation” xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml” Background=”#fff” Title=”WPF ListBox […]

Read More