Exemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="parentColumn"></param>
        /// <returns></returns>
        protected override Cell CreateCell(Column parentColumn)
        {
            SearchCell cell = new SearchCell(parentColumn);

            cell.CellEditorManager = new SearchEditor();

            bool           enable = true;
            GridColumnInfo info   = parentColumn.Tag as GridColumnInfo;

            if (info != null)
            {
                enable = info.GridColumnType == GridColumnType.Normal;
                if (enable)
                {
                    string     searchPropertyName = SearchCell.GetSearchPropertyName(info);
                    IBoundGrid grid = this.GridControl as IBoundGrid;
                    if (grid != null && grid.DisplayManager != null)
                    {
                        var p = grid.DisplayManager.EntityInfo.GetPropertMetadata(searchPropertyName);
                        if (p == null)
                        {
                            enable = false;
                        }
                    }
                }
            }
            cell.ReadOnly = !enable;
            return(cell);
        }
Exemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        public void ApplyFilters()
        {
            if (!this.Enabled)
            {
                return;
            }

            m_searchExps.Clear();

            int cellsCount = this.Cells.Count;

            for (int j = 0; j < cellsCount; j++)
            {
                if (!this.Cells[j].Visible)
                {
                    continue;
                }
                if (this.Cells[j].ReadOnly)
                {
                    continue;
                }

                SearchCell searchCell = (SearchCell)this.Cells[j];

                ISearchExpression filter = searchCell.GetSearchExpression();

                //object cellValue = dataRow.Cells[j].Value;
                if (filter != null)
                {
                    m_searchExps.Add(filter);
                }
            }

            //if (m_searchExps.Count > 0)
            {
                IBoundGrid grid = this.GridControl as IBoundGrid;
                if (grid != null)
                {
                    ISearchExpression exp = SearchExpression.ConvertListToOne(m_searchExps);
                    grid.DisplayManager.SearchManager.LoadData(exp, null);
                }
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="parentColumn"></param>
        /// <returns></returns>
        protected override Cell CreateCell(Column parentColumn)
        {
            SearchCell cell = new SearchCell(parentColumn);
            cell.CellEditorManager = new SearchEditor();

            bool enable = true;
            GridColumnInfo info = parentColumn.Tag as GridColumnInfo;
            if (info != null)
            {
                enable = info.GridColumnType == GridColumnType.Normal;
                if (enable)
                {
                    string searchPropertyName = SearchCell.GetSearchPropertyName(info);
                    IBoundGrid grid = this.GridControl as IBoundGrid;
                    if (grid != null && grid.DisplayManager != null)
                    {
                        var p = grid.DisplayManager.EntityInfo.GetPropertMetadata(searchPropertyName);
                        if (p == null)
                        {
                            enable = false;
                        }
                    }
                }
            }
            cell.ReadOnly = !enable;
            return cell;
        }
Exemplo n.º 4
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="template"></param>
 public SearchCell(SearchCell template)
     : base(template)
 {
 }
Exemplo n.º 5
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="template"></param>
 public SearchCell(SearchCell template)
     : base(template)
 {
 }