Exemplo n.º 1
0
 internal void Clear()
 {
     this.SortType            = ZCGridViewSortType.SortNone;
     this.FirstKey            = "";
     this.FirstKeyFilterType  = ZCGridViewKeyFilterType.FilterNone;
     this.SecondKey           = "";
     this.SecondKeyFilterType = ZCGridViewKeyFilterType.FilterNone;
     this.KeyLinkType         = ZCGridViewKeyLinkType.None;
     this.UseListFilter       = false;
     this.ListFilterKeys.Clear();
 }
Exemplo n.º 2
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            if (this.cbbFirstLogic.SelectedIndex >= 0 && !string.IsNullOrEmpty(this.txtFirstKey.Text))
            {
                ZCGridViewKeyFilterType ftype = (ZCGridViewKeyFilterType)this.cbbFirstLogic.SelectedIndex;
                helper.FirstKeyFilterType = ftype;
                helper.FirstKey           = this.txtFirstKey.Text;

                if (this.rdoAnd.Checked)
                {
                    helper.KeyLinkType = ZCGridViewKeyLinkType.And;
                }
                else if (this.rdoOr.Checked)
                {
                    helper.KeyLinkType = ZCGridViewKeyLinkType.Or;
                }
                else
                {
                    helper.KeyLinkType = ZCGridViewKeyLinkType.None;
                }

                if (helper.KeyLinkType != ZCGridViewKeyLinkType.None &&
                    this.cbbSecondLogic.SelectedIndex >= 0 &&
                    !string.IsNullOrEmpty(this.txtSecondKey.Text))
                {
                    ZCGridViewKeyFilterType stype = (ZCGridViewKeyFilterType)this.cbbSecondLogic.SelectedIndex;
                    helper.SecondKeyFilterType = stype;
                    helper.SecondKey           = this.txtSecondKey.Text;
                }
                helper.UseListFilter = false;
            }
            else
            {
                helper.UseListFilter        = true;
                helper.ListFilterSelectAll  = false;
                helper.ListFilterSelectNull = false;
                if (this.cklList.GetItemChecked(0) == true)
                {
                    helper.ListFilterSelectAll = true;
                    helper.ListFilterKeys.Clear();
                }
                else
                {
                    helper.ListFilterKeys.Clear();

                    if (helper.HasNullListKey && this.cklList.GetItemChecked(this.cklList.Items.Count - 1) == true)
                    {
                        helper.ListFilterSelectNull = true;
                    }
                    foreach (int index in this.cklList.CheckedIndices)
                    {
                        if (helper.HasNullListKey && index == this.cklList.Items.Count - 1)
                        {
                            continue;
                        }
                        else
                        {
                            helper.ListFilterKeys.Add(this.cklList.Items[index].ToString());
                        }
                    }
                }
                if (helper.ListFilterSelectAll)
                {
                    helper.UseListFilter = false;
                }
            }
            SortThisColumn();
            this.RefreshColumnInfo();
            this.Visible = false;
        }