Exemplo n.º 1
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);
        }
Exemplo n.º 2
0
        private void Panel_ChildrenChanged(object sender, ChildrenChangedEventArgs e)
        {
            IGridView child = e.Child as IGridView;

            if (child != null)
            {
                if (e.ChangeOperation == ItemsChangeOperation.Inserted)
                {
                    child.Initialize(this, this.template.MasterViewInfo);
                    if (this.currentView == null)
                    {
                        IRowView rowView = child as IRowView;
                        if (rowView != null)
                        {
                            this.currentView = rowView;
                        }
                    }
                }
                if (e.ChangeOperation == ItemsChangeOperation.Removed)
                {
                    child.Detach();
                    if (child == this.CurrentView)
                    {
                        this.CurrentView = (IRowView)null;
                    }
                }
            }
            if (e.ChangeOperation != ItemsChangeOperation.Cleared)
            {
                return;
            }
            this.CurrentView = (IRowView)null;
        }
Exemplo n.º 3
0
        public Rectangle GetCellElement(GridViewRowInfo row, GridViewColumn col)
        {
            IRowView rowView = this.owner.GridViewElement.GetRowView(row.ViewInfo);

            if (rowView != null)
            {
                GridCellElement cellElement = rowView.GetCellElement(row, col);
                if (cellElement != null)
                {
                    return(cellElement.ControlBoundingRectangle);
                }
            }
            return(new Rectangle(0, 0, 0, 0));
        }
Exemplo n.º 4
0
 private void GetRowViews(IRowView view, GridViewInfo viewInfo, List <IRowView> results)
 {
     if (view.ViewInfo == viewInfo)
     {
         results.Add(view);
     }
     else
     {
         foreach (IRowView childView in view.ChildViews)
         {
             this.GetRowViews(childView, viewInfo, results);
         }
     }
 }
        public Rectangle GetRowElement(GridViewRowInfo row)
        {
            IRowView rowView = this.owner.GridViewElement.GetRowView(row.ViewInfo);

            if (rowView != null)
            {
                GridRowElement rowElement = rowView.GetRowElement(row);
                if (rowElement != null)
                {
                    return(rowElement.ControlBoundingRectangle);
                }
            }
            return(new Rectangle(0, 0, 0, 0));
        }
Exemplo n.º 6
0
 private IRowView GetRowView(IRowView view, GridViewInfo viewInfo)
 {
     if (view.ViewInfo == viewInfo)
     {
         return(view);
     }
     foreach (IRowView childView in view.ChildViews)
     {
         IRowView rowView = this.GetRowView(childView, viewInfo);
         if (rowView != null)
         {
             return(rowView);
         }
     }
     return((IRowView)null);
 }
Exemplo n.º 7
0
 public IRowView GetRowView(GridViewInfo viewInfo)
 {
     foreach (RadElement child in this.Panel.Children)
     {
         IRowView view = child as IRowView;
         if (view != null)
         {
             if (view.ViewInfo == viewInfo)
             {
                 return(view);
             }
             IRowView rowView = this.GetRowView(view, viewInfo);
             if (rowView != null)
             {
                 return(rowView);
             }
         }
     }
     return((IRowView)null);
 }
Exemplo n.º 8
0
        public IEnumerable <IRowView> GetRowViews(GridViewInfo viewInfo)
        {
            List <IRowView> results = new List <IRowView>();

            foreach (RadElement child in this.Panel.Children)
            {
                IRowView view = child as IRowView;
                if (view != null)
                {
                    if (view.ViewInfo == viewInfo)
                    {
                        results.Add(view);
                    }
                    else
                    {
                        this.GetRowViews(view, viewInfo, results);
                    }
                }
            }
            return((IEnumerable <IRowView>)results);
        }
Exemplo n.º 9
0
        private void SetViewElement()
        {
            IRowView rowView = this.GetRowView(this.template.MasterViewInfo);
            Color    color   = Color.Empty;
            bool     flag    = true;

            if (rowView != null)
            {
                GridTableElement gridTableElement = rowView as GridTableElement;
                if (gridTableElement != null)
                {
                    if (gridTableElement.GetValueSource(GridTableElement.AlternatingRowColorProperty) == ValueSource.Local)
                    {
                        color = gridTableElement.AlternatingRowColor;
                    }
                    if (gridTableElement.GetValueSource(GridTableElement.EnableHotTrackingProperty) == ValueSource.Local)
                    {
                        flag = gridTableElement.EnableHotTracking;
                    }
                }
                ((DisposableObject)rowView).Dispose();
            }
            IRowView viewUiElement = this.template.ViewDefinition.CreateViewUIElement(this.template.MasterViewInfo);

            if (viewUiElement != null)
            {
                GridTableElement gridTableElement = viewUiElement as GridTableElement;
                if (gridTableElement != null)
                {
                    if (!color.IsEmpty)
                    {
                        gridTableElement.AlternatingRowColor = color;
                    }
                    gridTableElement.EnableHotTracking = flag;
                }
            }
            this.panel.Children.Add((RadElement)viewUiElement);
        }
Exemplo n.º 10
0
 public void UnhookView(IRowView rowView)
 {
     rowViews.Remove(rowView);
 }
Exemplo n.º 11
0
 public void HookView(IRowView rowView)
 {
     rowViews.Add(rowView);
     rowView.Initiate(rowModel.Cells, rowModel.Columns);
 }
Exemplo n.º 12
0
 public TileRow(Lv p_owner, IRowView p_rowView, LvItem p_item) : base(p_owner)
 {
     LoadContent(p_rowView.Create(p_item));
     AttachEvent();
 }