Ejemplo n.º 1
0
        GridViewEventResult IGridViewEventListener.ProcessEvent(
            GridViewEvent eventData)
        {
            GridViewColumn sender1 = eventData.Sender as GridViewColumn;

            if (sender1 != null && eventData.Info.Id == KnownEvents.PropertyChanged)
            {
                RadPropertyChangedEventArgs changedEventArgs = eventData.Arguments[0] as RadPropertyChangedEventArgs;
                if (changedEventArgs.Property == GridViewColumn.IsVisibleProperty || changedEventArgs.Property == GridViewColumn.VisibleInColumnChooserProperty)
                {
                    this.template = sender1.OwnerTemplate;
                    this.UpdateView();
                }
            }
            else if (eventData.Info.Id == KnownEvents.ViewChanged)
            {
                DataViewChangedEventArgs changedEventArgs = eventData.Arguments[0] as DataViewChangedEventArgs;
                GridViewTemplate         sender2          = eventData.Sender as GridViewTemplate;
                if (changedEventArgs.Action == ViewChangedAction.Reset || changedEventArgs.Action == ViewChangedAction.ColumnGroupPropertyChanged)
                {
                    this.template = sender2;
                    this.UpdateView();
                }
            }
            return((GridViewEventResult)null);
        }
Ejemplo n.º 2
0
        protected virtual GridViewEventResult ProcessViewChangedEvent(
            GridViewEvent eventData)
        {
            DataViewChangedEventArgs changedEventArgs = eventData.Arguments[0] as DataViewChangedEventArgs;

            if (changedEventArgs.Action == ViewChangedAction.Reset)
            {
                this.groupPanelElement.UpdateVisibility();
            }
            else if (changedEventArgs.Action == ViewChangedAction.CurrentViewChanged)
            {
                GridViewInfo oldView = (GridViewInfo)null;
                if (this.currentView != null)
                {
                    oldView = this.currentView.ViewInfo;
                }
                IRowView rowView = this.GetRowView((GridViewInfo)changedEventArgs.NewItems[0]);
                if (rowView != null)
                {
                    this.currentView = rowView;
                }
                this.OnCurrentViewChanged(new GridViewCurrentViewChangedEventArgs(oldView, (GridViewInfo)changedEventArgs.NewItems[0]));
            }
            return((GridViewEventResult)null);
        }
Ejemplo n.º 3
0
        private void ProcessViewChanged(DataViewChangedEventArgs args)
        {
            if (args.Action != ViewChangedAction.Reset)
            {
                return;
            }
            bool flag = false;

            foreach (GridViewDataColumn column in (Collection <GridViewDataColumn>) this.ViewTemplate.Columns)
            {
                if (column.FilterDescriptor == null)
                {
                    this.CreateFilterDescriptor(column, this.GetDefaultFilterOperator(column));
                    if (column is GridViewCheckBoxColumn)
                    {
                        flag = true;
                    }
                }
            }
            if (!flag)
            {
                return;
            }
            this.InvalidateRow();
        }
Ejemplo n.º 4
0
        private void DispatchDataViewChangedEvent(DataViewChangedEventArgs args, GridEventType type)
        {
            GridViewEventInfo eventInfo = new GridViewEventInfo(KnownEvents.ViewChanged, type, GridEventDispatchMode.Send);

            GridViewSynchronizationService.DispatchEvent(this.owner, new GridViewEvent((object)this.owner, (object)this.owner, new object[1]
            {
                (object)args
            }, eventInfo), false);
        }
Ejemplo n.º 5
0
 public GridViewEventResult PostProcessEvent(GridViewEvent eventData)
 {
     if (eventData.Info.Id == KnownEvents.ViewChanged)
     {
         DataViewChangedEventArgs changedEventArgs = eventData.Arguments[0] as DataViewChangedEventArgs;
         if (changedEventArgs.Action == ViewChangedAction.Add || changedEventArgs.Action == ViewChangedAction.Remove || (changedEventArgs.Action == ViewChangedAction.FilteringChanged || changedEventArgs.Action == ViewChangedAction.GroupingChanged) || (changedEventArgs.Action == ViewChangedAction.PagingChanged || changedEventArgs.Action == ViewChangedAction.Reset))
         {
             this.UpdateVisibility();
             this.UpdateView();
         }
     }
     return((GridViewEventResult)null);
 }
Ejemplo n.º 6
0
        public GridViewEventResult ProcessEvent(GridViewEvent eventData)
        {
            if (eventData.Info.Id == KnownEvents.ViewChanged)
            {
                DataViewChangedEventArgs changedEventArgs = (DataViewChangedEventArgs)eventData.Arguments[0];
                switch (changedEventArgs.Action)
                {
                case ViewChangedAction.Add:
                    if (changedEventArgs.NewItems[0] is GridViewDataRowInfo)
                    {
                        this.UpdateDistinctValues();
                        this.UpdateDistinctValuesWithFilter();
                        break;
                    }
                    break;

                case ViewChangedAction.Remove:
                    if (changedEventArgs.NewItems[0] is GridViewDataRowInfo)
                    {
                        this.UpdateDistinctValues();
                        this.UpdateDistinctValuesWithFilter();
                        break;
                    }
                    break;

                case ViewChangedAction.Reset:
                    this.distinctValues           = (GridViewColumnValuesCollection)null;
                    this.distinctValuesWithFilter = (GridViewColumnValuesCollection)null;
                    break;

                case ViewChangedAction.ItemChanged:
                    if (changedEventArgs.NewItems[0] is GridViewDataRowInfo)
                    {
                        this.UpdateDistinctValues();
                        this.UpdateDistinctValuesWithFilter();
                        break;
                    }
                    break;
                }
            }
            else if (eventData.Info.Id == KnownEvents.CollectionChanged)
            {
                NotifyCollectionChangedEventArgs changedEventArgs = (NotifyCollectionChangedEventArgs)eventData.Arguments[0];
                if (changedEventArgs.Action == NotifyCollectionChangedAction.Remove && changedEventArgs.NewItems[0] == this)
                {
                    this.OwnerTemplate.MasterTemplate.SynchronizationService.RemoveListener((IGridViewEventListener)this);
                }
            }
            return((GridViewEventResult)null);
        }
Ejemplo n.º 7
0
        private bool IsGridViewEventToRemove(GridViewEvent gridEvent)
        {
            if (GridViewSynchronizationService.IsTemplatePropertyChangingEvent(gridEvent))
            {
                return((gridEvent.Arguments[0] as PropertyChangingEventArgsEx).PropertyName == "DataSource");
            }
            if (gridEvent.Info.Id != KnownEvents.ViewChanged)
            {
                return(false);
            }
            DataViewChangedEventArgs changedEventArgs = gridEvent.Arguments[0] as DataViewChangedEventArgs;
            int action = (int)changedEventArgs.Action;

            return(changedEventArgs.Action == ViewChangedAction.Reset);
        }
Ejemplo n.º 8
0
        bool IGridViewEventListener.AnalyzeQueue(List <GridViewEvent> events)
        {
            int count = events.Count;

            for (int index = count - 1; index >= 0; --index)
            {
                GridViewEvent gridViewEvent = events[index];
                if (gridViewEvent.Info.Id == KnownEvents.ViewChanged)
                {
                    DataViewChangedEventArgs changedEventArgs = gridViewEvent.Arguments[0] as DataViewChangedEventArgs;
                    if (changedEventArgs.Action == ViewChangedAction.FilteringChanged || changedEventArgs.Action == ViewChangedAction.FilterExpressionChanged)
                    {
                        events.RemoveAll(new Predicate <GridViewEvent>(this.IsGridViewEventToRemove));
                        return(count != events.Count);
                    }
                }
            }
            return(false);
        }
Ejemplo n.º 9
0
 GridViewEventResult IGridViewEventListener.PostProcessEvent(
     GridViewEvent eventData)
 {
     if (eventData.Info.Id == KnownEvents.ViewChanged)
     {
         DataViewChangedEventArgs changedEventArgs = eventData.Arguments[0] as DataViewChangedEventArgs;
         if (changedEventArgs.Action == ViewChangedAction.Add || changedEventArgs.Action == ViewChangedAction.Remove || (changedEventArgs.Action == ViewChangedAction.FilteringChanged || changedEventArgs.Action == ViewChangedAction.GroupingChanged) || (changedEventArgs.Action == ViewChangedAction.SortingChanged || changedEventArgs.Action == ViewChangedAction.ItemChanged || changedEventArgs.Action == ViewChangedAction.Reset))
         {
             this.cache.Clear();
             this.Search(this.searchCriteria);
         }
         else if ((changedEventArgs.Action == ViewChangedAction.CurrentCellChanged || changedEventArgs.Action == ViewChangedAction.CurrentColumnChanged || changedEventArgs.Action == ViewChangedAction.CurrentRowChanged) && !this.isNavigating)
         {
             this.selectionChangedByUser = true;
         }
     }
     else if (eventData.Info.Id == KnownEvents.PropertyChanged && eventData.Sender is GridViewDataColumn && (eventData.Arguments[0] as RadPropertyChangedEventArgs).Property.Name == "IsVisible")
     {
         this.cache.Clear();
         this.Search(this.searchCriteria);
     }
     return((GridViewEventResult)null);
 }
Ejemplo n.º 10
0
 private void DispatchDataViewChangedEvent(DataViewChangedEventArgs args)
 {
     this.DispatchDataViewChangedEvent(args, GridEventType.Both);
 }