Exemplo n.º 1
0
 private void CbFilterNameSelectedIndexChanged(object sender, EventArgs e)
 {
     if (cbFilterName.SelectedIndex >= 0)
         CurrentFilter = _FilterData[cbFilterName.SelectedIndex];
 }
Exemplo n.º 2
0
        private UserFilterData GetNewFilter()
        {
            UserFilterData fd = new UserFilterData();

            fd.Name = GetNewFilterName();
            fd.Description = "";

            _FilterData.Add(fd);

            return (fd);
        }
Exemplo n.º 3
0
 private void BtnNewFilterClick(object sender, EventArgs e)
 {
     CurrentFilter = GetNewFilter();
 }
Exemplo n.º 4
0
        private void BtnDeleteFilterClick(object sender, EventArgs e)
        {
            if (CurrentFilter != null)
            {
                _FilterData.Remove(CurrentFilter);

                UpdateFilterNameCombo();

                CurrentFilter = (_FilterData.Count > 0)
                    ? _FilterData[0] : GetNewFilter();
            }
        }
Exemplo n.º 5
0
        private void InitializeFilter(string filterText)
        {
            if (_GridColumn != null)
            {
                _FilterExpr = _GridColumn.FilterExpr;
                _FilterValue = _GridColumn.FilterValue;
                _FilterDisplayValue = _GridColumn.FilterDisplayValue;
            }
            else
            {
                _FilterExpr = _GridPanel.FilterExpr;
                _FilterValue = null;
                _FilterDisplayValue = null;

                cbxShowInPopup.Visible = false;
            }

            filterExprEdit1.GridPanel = _GridPanel;
            filterExprEdit1.GridColumn = _GridColumn;
            filterExprEdit1.InputText = filterText;

            CurrentFilter = GetCurrentFilter();
        }
Exemplo n.º 6
0
        ///<summary>
        /// LoadFilterData
        ///</summary>
        ///<returns></returns>
        static public List<UserFilterData> LoadFilterData(GridPanel gridPanel)
        {
            _filterData = new List<UserFilterData>();

            string path = _filterPath;

            if (gridPanel.SuperGrid.DoFilterLoadUserDataEvent(
                gridPanel, ref path, ref _filterData) == false)
            {
                if (File.Exists(path) == true)
                {
                    using (XmlReader reader = XmlReader.Create(path))
                    {
                        UserFilterData fd = null;

                        while (reader.Read())
                        {
                            if (reader.IsStartElement())
                            {
                                switch (reader.Name)
                                {
                                    case "Filter":
                                        fd = new UserFilterData();
                                        _filterData.Add(fd);
                                        break;

                                    case "Name":
                                        if (reader.Read())
                                        {
                                            if (fd != null)
                                                fd.Name = reader.Value.Trim();
                                        }
                                        break;

                                    case "Description":
                                        if (reader.Read())
                                        {
                                            if (fd != null)
                                                fd.Description = reader.Value.Trim();
                                        }
                                        break;

                                    case "Expression":
                                        if (reader.Read())
                                        {
                                            if (fd != null)
                                                fd.Expression = reader.Value.Trim();
                                        }
                                        break;

                                    case "ReferNames":
                                        if (reader.Read())
                                        {
                                            if (fd != null)
                                                fd.ReferNamesString = reader.Value.Trim();
                                        }
                                        break;
                                }
                            }
                        }
                    }
                }
            }

            return (_filterData);
        }