|
using System.Windows.Controls;
using DataGridDemo1.ViewModels;
namespace DataGridDemo1.Views
{
public partial class MainView : UserControl
{
public MainView()
{
InitializeComponent();
(Resources["MainViewModel"] as MainViewModel).GroupDataByColumnName("State");
(Resources["MainViewModel"] as MainViewModel).GroupDataByColumnName("Department");
}
private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
string groupName = ((sender as ComboBox).SelectedItem as ComboBoxItem).Content.ToString();
(Resources["MainViewModel"] as MainViewModel).GroupDataByColumnName(groupName);
}
private void TextBox_TextChanged(object sender, TextChangedEventArgs e)
{
string searchKey = (sender as TextBox).Text.Trim().ToLower();
(Resources["MainViewModel"] as MainViewModel).FilterDataBySearchKey(searchKey);
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Kunal Chowdhury is a former Microsoft "Windows Platform Development" MVP (Most Valuable Professional, 2010 - 2018), a Codeproject Mentor, Speaker in various Microsoft events, Author, passionate Blogger and a Senior Technical Lead by profession.
He is currently working in an MNC located in India. He has a very good skill over XAML, C#, Silverlight, Windows Phone, WPF and Windows app development. He posts his findings, articles, tutorials in his technical blog (www.kunal-chowdhury.com) and CodeProject.
Books authored:
Connect with Kunal on: