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 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