示例#1
0
        /// <summary>
        /// Search filter the Filters
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SrchBox_TextChanged(object sender, EventArgs e)
        {
            if (string.Equals("Contains ..", SrchBox.Text))
            {
                SrchBox.Clear();
            }
            if (!string.Equals("Contains ..", SrchBox.Text))
            {
                SrchBox.Font      = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                SrchBox.ForeColor = System.Drawing.SystemColors.WindowText;
                var registrationsList = currentStore.Keys.ToList(); //return original data from Store

                filtersList.BeginUpdate();
                filtersList.Items.Clear();

                if (!string.IsNullOrEmpty(SrchBox.Text))
                {
                    foreach (string str in registrationsList)
                    {
                        if (str.IndexOf(SrchBox.Text, StringComparison.InvariantCultureIgnoreCase) >= 0)
                        {
                            filtersList.Items.Add(str);
                        }
                    }
                }
                else
                {
                    filtersList.Items.AddRange(registrationsList.ToArray()); //there is no any filter string, so add all data we have in Store
                }
                filtersList.EndUpdate();
                totalLbl.Text = filtersList.Items.Count.ToString();
                totalLbl.Update();
            }
        }
示例#2
0
 private void ClearBtn_Click(object sender, EventArgs e)
 {
     SrchBox.Clear();
     Load_Fine_View();
     if (SrchAllFinesGrp.Visible == true)
     {
         SrchAllTxtBox.Clear();
         SrchAllFinesGrp.Hide();
     }
     Load_Fine_View();
 }