示例#1
0
 public void Initialize(RadGridViewElement gridViewElement, GridViewInfo viewInfo)
 {
     this.gridViewElement = gridViewElement;
     this.viewInfo        = viewInfo;
     this.viewInfo.ViewTemplate.MasterTemplate.SynchronizationService.AddListener((IGridViewEventListener)this);
     this.UpdateVisibility();
 }
示例#2
0
 public ColumnChooserControl(RadGridViewElement rootElement)
 {
     if (this.element == null)
     {
         return;
     }
     this.element.Initialize(rootElement, (GridViewInfo)null);
 }
        public GridViewColumnChooser(GridViewTemplate template, RadGridViewElement rootElement)
        {
            this.InitializeComponent();
            this.Template        = template;
            this.GridRootElement = rootElement;
            this.Text            = LocalizationProvider <RadGridLocalizationProvider> .CurrentProvider.GetLocalizedString("ColumnChooserFormCaption");

            this.ColumnChooserControl.ItemElementCreating += new ColumnChooserItemElementCreatingEventHandler(this.ColumnChooserControl_ItemElementCreating);
        }
 public ColumnChooserItemElementCreatingEventArgs(
     ColumnChooserItem itemElement,
     GridViewColumn column,
     RadGridViewElement gridViewElement)
 {
     this.itemElement     = itemElement;
     this.column          = column;
     this.gridViewElement = gridViewElement;
 }
示例#5
0
 private void DetachGridElement()
 {
     if (this.gridViewElement == null)
     {
         return;
     }
     this.gridViewElement.Template.SynchronizationService.RemoveListener((IGridViewEventListener)this);
     this.gridViewElement = (RadGridViewElement)null;
 }
示例#6
0
 public void Dispose()
 {
   if (this.rootElement != null)
   {
     this.rootElement.Template.SynchronizationService.RemoveListener((IGridViewEventListener) this);
     this.rootElement = (RadGridViewElement) null;
   }
   if (this.contextMenu == null)
     return;
   this.contextMenu.Dispose();
 }
示例#7
0
 public void Initialize(RadGridViewElement gridViewElement, GridViewInfo viewInfo)
 {
     this.gridViewElement = gridViewElement;
     if (this.gridViewElement != null)
     {
         gridViewElement.Template.SynchronizationService.AddListener((IGridViewEventListener)this);
     }
     if (viewInfo == null)
     {
         return;
     }
     this.ViewTemplate = viewInfo.ViewTemplate;
 }
示例#8
0
 public override void Initialize(RadGridViewElement gridRootElement)
 {
     base.Initialize(gridRootElement);
     foreach (KeyValuePair <System.Type, IGridBehavior> rowBehavior in (IEnumerable <KeyValuePair <System.Type, IGridBehavior> >) this.rowBehaviors)
     {
         rowBehavior.Value.Initialize(this.GridViewElement);
     }
     if (this.defaultRowBehavior == null)
     {
         return;
     }
     this.defaultRowBehavior.Initialize(this.GridViewElement);
 }
        private void CorrectScrollbarRangeInHierarchy()
        {
            GridTableElement       tableElement    = ((RowsContainerElement)this.Parent).TableElement;
            RadGridViewElement     gridViewElement = tableElement.GridViewElement;
            RadScrollBarElement    vscrollBar      = tableElement.VScrollBar;
            MasterGridViewTemplate masterTemplate  = tableElement.MasterTemplate;

            if (masterTemplate == null || masterTemplate.Templates.Count == 0 || (gridViewElement.UseScrollbarsInHierarchy || tableElement.ViewInfo.ParentRow != null) || (this.Children.Count == 0 || vscrollBar.Value < vscrollBar.Maximum - vscrollBar.LargeChange + 1))
            {
                return;
            }
            GridDetailViewRowElement child1 = this.Children[this.Children.Count - 1] as GridDetailViewRowElement;

            if (child1 == null || child1.ContentCell.ChildTableElement.ViewInfo == null)
            {
                return;
            }
            ScrollableRowsContainerElement scrollableRows = child1.ContentCell.ChildTableElement.ViewElement.ScrollableRows;
            int           count         = scrollableRows.Children.Count;
            GridTraverser gridTraverser = new GridTraverser(child1.ContentCell.ChildTableElement.ViewInfo);

            gridTraverser.TraversalMode = GridTraverser.TraversalModes.ScrollableRows;
            int num1 = 0;

            while (gridTraverser.MoveNext())
            {
                ++num1;
                if (num1 > count)
                {
                    int height = (int)child1.ContentCell.ChildTableElement.RowElementProvider.GetElementSize(gridTraverser.Current).Height;
                    tableElement.RowScroller.UpdateScrollRange(vscrollBar.Maximum + height, false);
                    return;
                }
            }
            if (scrollableRows.Children.Count <= 0)
            {
                return;
            }
            GridRowElement child2 = (GridRowElement)scrollableRows.Children[scrollableRows.Children.Count - 1];

            if (child2.ControlBoundingRectangle.Bottom <= scrollableRows.ControlBoundingRectangle.Bottom)
            {
                return;
            }
            int num2 = child2.ControlBoundingRectangle.Bottom - scrollableRows.ControlBoundingRectangle.Bottom;

            tableElement.RowScroller.UpdateScrollRange(vscrollBar.Maximum + num2, false);
        }
示例#10
0
 private void ProcessKeyDown(KeyEventArgs e)
 {
     if (this.OwnerElement == null || !this.OwnerElement.IsInValidState(true))
     {
         return;
     }
     if (this.gridRootElement == null)
     {
         this.gridRootElement = this.OwnerElement.ElementTree.RootElement.FindDescendant <RadGridViewElement>();
     }
     if (this.gridRootElement == null)
     {
         return;
     }
     e.Handled = this.gridRootElement.GridBehavior.ProcessKeyDown(e);
 }
示例#11
0
 public virtual void OnKeyDown(KeyEventArgs keyEventArgs)
 {
     if (this.OwnerElement == null || !this.OwnerElement.IsInValidState(true))
     {
         return;
     }
     if (this.gridRootElement == null)
     {
         this.gridRootElement = this.OwnerElement.ElementTree.RootElement.FindDescendant <RadGridViewElement>();
     }
     if (this.gridRootElement == null)
     {
         return;
     }
     keyEventArgs.Handled = this.gridRootElement.GridBehavior.ProcessKeyDown(keyEventArgs);
 }
        private void ValidateRowIndicator(RadMaskedEditBoxEditorElement editor)
        {
            RadGridViewElement ancestor = this.MaskTextBox.FindAncestor <RadGridViewElement>();

            if (ancestor == null)
            {
                return;
            }
            if (!((RegexMaskTextBoxProvider)editor.Provider).IsValid)
            {
                ancestor.CurrentRow.ErrorText = "Value is not valid";
            }
            else
            {
                ancestor.CurrentRow.ErrorText = string.Empty;
            }
        }
        protected override void RemoveElement(int position)
        {
            RadGridViewElement gridViewElement = ((RowsContainerElement)this.Parent).TableElement.GridViewElement;
            BaseGridEditor     activeEditor    = gridViewElement.ActiveEditor as BaseGridEditor;

            if (gridViewElement.IsInEditMode && (activeEditor == null || !activeEditor.IsInBeginEditMode))
            {
                GridViewRowInfo        gridViewRowInfo    = ((GridRowElement)this.Children[position]).RowInfo;
                GridViewDetailsRowInfo viewDetailsRowInfo = gridViewRowInfo as GridViewDetailsRowInfo;
                if (viewDetailsRowInfo != null)
                {
                    gridViewRowInfo = (GridViewRowInfo)viewDetailsRowInfo.Owner;
                }
                if (gridViewRowInfo == gridViewElement.CurrentRow || gridViewElement.CurrentRow != null && gridViewElement.CurrentRow.ViewInfo != null && (gridViewElement.CurrentRow.ViewInfo.ParentRow != null && !gridViewElement.CurrentRow.ViewInfo.ParentRow.IsPinned) && gridViewElement.CurrentRow.ViewInfo.ParentRow.ViewInfo == gridViewRowInfo.ViewInfo)
                {
                    gridViewElement.CloseEditor();
                }
            }
            base.RemoveElement(position);
        }
示例#14
0
 public GridViewEditManager(RadGridViewElement gridViewElement)
 {
     this.gridViewElement = gridViewElement;
     this.gridViewElement.Template.SynchronizationService.AddListener((IGridViewEventListener)this);
 }
示例#15
0
 public virtual void Initialize(RadGridViewElement gridViewElement)
 {
     this.gridViewElement = gridViewElement;
 }
示例#16
0
 public RadGridViewDragDropService(RadGridViewElement gridViewElement)
 {
     this.gridViewElement = gridViewElement;
 }
示例#17
0
 public GridViewContextMenuManager(RadGridViewElement rootElement)
 {
   this.rootElement = rootElement;
   this.rootElement.Template.SynchronizationService.AddListener((IGridViewEventListener) this);
 }