using System.Collections.Generic; using Tanshu.Accounts.Contracts; using Tanshu.Data; namespace Tanshu.Accounts.Helpers { public class SelectProduct : Tanshu.Data.BaseSelector { public SelectProduct(GetData getData, bool autoClose) : base(getData, true, "List of Products") { var filters = new List {"Name", "Type"}; SetFilterColumns(filters); grid.Columns["ProductID"].Visible = false; } protected override void FilterChanged(Dictionary filter) { data = getData(filter); bindingSource.DataSource = data; } protected override void UpdateDisplay(ProductDisplaySmall item) { DisplayLabel = item == null ? "" : string.Format("Chosen Product {0} with rate Rs. {1}", item.Name, item.Price); } protected override ProductDisplaySmall HandleKeydown(object sender, ExtendedKeyEventArgs e) { e.Handled = false; return null; } #region Designer Code /// /// Required designer variable. /// private System.ComponentModel.IContainer components = null; /// /// Clean up any resources being used. /// /// true if managed resources should be disposed; otherwise, false. protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form Designer generated code /// /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// private void InitializeComponent() { this.components = new System.ComponentModel.Container(); } #endregion #endregion } }