Ejemplo n.º 1
0
 public CSGridRowHeaderCellElement(GridViewColumn column, GridRowElement row, string columnName, object value, Image image)
     : base(column, row)
 {
     _columnName = columnName;
     _value      = value;
     _image      = image;
 }
Ejemplo n.º 2
0
 internal static void ReleaseRowElement(
     RadGridView radGridView,
     RowElementProvider rowProvider,
     GridRowElement rowElement)
 {
     GridExportUtils.ReleaseRowElement(radGridView, rowProvider, rowElement, true);
 }
Ejemplo n.º 3
0
        void checkBox_CheckStateChanged(object sender, EventArgs e)
        {
            RadCheckBoxElement checkBox = sender as RadCheckBoxElement;
            GridRowElement     row      = checkBox.FindAncestor <GridRowElement>();

            row.RowInfo.Tag = checkBox.IsChecked.ToString();
        }
Ejemplo n.º 4
0
 internal static void ReleaseCellElement(
     CellElementProvider cellProvider,
     GridRowElement rowElement,
     GridCellElement cell)
 {
     GridExportUtils.ReleaseCellElement(cellProvider, rowElement, cell, true);
 }
Ejemplo n.º 5
0
        public override void Collapse(GridViewRowInfo rowInfo, float maxOffset, int rowIndex)
        {
            this.IsAnimating = true;
            this.OnUpdateViewNeeded(EventArgs.Empty);
            IList <GridRowElement> visualRows = this.TableElement.VisualRows;

            for (int index = rowIndex; index < visualRows.Count; ++index)
            {
                GridRowElement gridRowElement = visualRows[index];
                if (gridRowElement.Visibility != ElementVisibility.Hidden)
                {
                    new AnimatedPropertySetting(VisualElement.OpacityProperty, (object)0.0, (object)1.0, 9, 30)
                    {
                        ApplyEasingType  = RadEasingType.OutQuint,
                        RemoveAfterApply = true,
                        ApplyDelay       = ((index - rowIndex) * 25)
                    }.ApplyValue((RadObject)gridRowElement);
                    AnimatedPropertySetting animatedPropertySetting = new AnimatedPropertySetting(RadElement.PositionOffsetProperty, (object)new SizeF(0.0f, maxOffset), (object)new SizeF(0.0f, 0.0f), 9, 30);
                    animatedPropertySetting.ApplyEasingType  = RadEasingType.OutQuad;
                    animatedPropertySetting.RemoveAfterApply = true;
                    animatedPropertySetting.ApplyDelay       = (index - rowIndex) * 25;
                    animatedPropertySetting.ApplyValue((RadObject)gridRowElement);
                    if (index == visualRows.Count - 1)
                    {
                        animatedPropertySetting.AnimationFinished += new AnimationFinishedEventHandler(this.CollapseSetting_AnimationFinished);
                    }
                }
            }
        }
Ejemplo n.º 6
0
            private void CreateStackElement(GridRowElement row)
            {
                this.stack = new StackLayoutElement();
                this.stack.AutoSizeMode        = Telerik.WinControls.RadAutoSizeMode.FitToAvailableSize;
                this.stack.AutoSize            = true;
                this.stack.StretchHorizontally = true;
                this.stack.Alignment           = ContentAlignment.BottomCenter;
                this.stack.DrawFill            = true;
                this.stack.BackColor           = Color.White;
                int i = 0;

                while (i < row.RowInfo.Cells.Count)
                {
                    SummaryCellElement element = new SummaryCellElement();
                    element.ColumnName          = row.RowInfo.Cells[i].ColumnInfo.Name;
                    element.StretchHorizontally = false;
                    element.StretchVertically   = true;
                    element.DrawBorder          = true;
                    element.BorderGradientStyle = Telerik.WinControls.GradientStyles.Solid;
                    element.BorderColor         = Color.LightBlue;
                    element.ForeColor           = Color.Black;
                    element.GradientStyle       = GradientStyles.Solid;
                    this.stack.Children.Add(element);
                    i += 1;
                }

                this.Children.Add(this.stack);
            }
Ejemplo n.º 7
0
        internal static double GetRowHeight(
            RadGridView radGridView,
            RowElementProvider rowProvider,
            CellElementProvider cellProvider,
            GridViewRowInfo gridViewRowInfo,
            bool exportVisualSettings)
        {
            double val1 = 0.0;

            if (radGridView.AutoSizeRows && exportVisualSettings)
            {
                GridRowElement element1 = rowProvider.GetElement(gridViewRowInfo, (object)null) as GridRowElement;
                element1.InitializeRowView(radGridView.TableElement);
                element1.Initialize(gridViewRowInfo);
                radGridView.TableElement.Children.Add((RadElement)element1);
                foreach (GridViewColumn column in (Collection <GridViewDataColumn>)element1.ViewTemplate.Columns)
                {
                    if (!(column is GridViewRowHeaderColumn) && !(column is GridViewIndentColumn))
                    {
                        GridCellElement element2 = cellProvider.GetElement(column, (object)element1) as GridCellElement;
                        element1.Children.Add((RadElement)element2);
                        element2.Initialize(column, element1);
                        val1 = Math.Max(val1, (double)GridExportUtils.GetCellDesiredSize(element2).Height);
                        GridExportUtils.ReleaseCellElement(cellProvider, element1, element2);
                    }
                }
                GridExportUtils.ReleaseRowElement(radGridView, rowProvider, element1);
            }
            return(Math.Max(val1, (double)radGridView.TableElement.RowScroller.ElementProvider.GetElementSize(gridViewRowInfo).Height));
        }
Ejemplo n.º 8
0
 public ChartCellElement(GridViewColumn column, GridRowElement row)
     : base(column, row)
 {
     this.Padding        = new Padding(0);
     chart.View.Margin   = new System.Windows.Forms.Padding(3);
     chart.View.MinSize  = new SizeF(10, 10);
     chart.GradientStyle = Telerik.WinControls.GradientStyles.Solid;
 }
Ejemplo n.º 9
0
        public override void Initialize(GridViewColumn column, GridRowElement row)
        {
            base.Initialize(column, row);

            ((RadioPrimitive)radioButtonElement1.Children[1].Children[1].Children[0]).BackColor2 = Color.Red;
            ((RadioPrimitive)radioButtonElement2.Children[1].Children[1].Children[0]).BackColor2 = Color.Blue;
            ((RadioPrimitive)radioButtonElement3.Children[1].Children[1].Children[0]).BackColor2 = Color.Green;
        }
Ejemplo n.º 10
0
 private GridDataCellElement GetCell(GridRowElement rowElement, int index)
 {
     foreach (GridCellElement cell in rowElement.VisualCells)
     {
         if (cell.ColumnInfo != null && cell.ColumnInfo.Index == index)
         {
             return(cell as GridDataCellElement);
         }
     }
     return(null);
 }
Ejemplo n.º 11
0
            public MyGridGroupContentCellElement(GridViewColumn column, GridRowElement row) : base(column, row)
            {
                // creating the elements here in order to have a valid insance of a row
                if (this.stack == null)
                {
                    this.CreateStackElement(row);
                }

                this.ClipDrawing = true;
                row.GridControl.TableElement.HScrollBar.Scroll     += HScrollBar_Scroll;
                row.GridControl.ColumnWidthChanged                 += GridControl_ColumnWidthChanged;
                row.GridControl.GroupDescriptors.CollectionChanged += GroupDescriptors_CollectionChanged;
            }
Ejemplo n.º 12
0
 internal static void ReleaseRowElement(
     RadGridView radGridView,
     RowElementProvider rowProvider,
     GridRowElement rowElement,
     bool cacheRow)
 {
     if (cacheRow)
     {
         rowProvider.CacheElement((IVirtualizedElement <GridViewRowInfo>)rowElement);
     }
     rowElement.Detach();
     radGridView.TableElement.Children.Remove((RadElement)rowElement);
     rowElement.ResumeLayout(false);
 }
        public IndicatedDateTimeCellElement(GridViewColumn column, GridRowElement row)
            : base(column, row)
        {
            //this code adds a registration for RadDropDownListArrowButtonElement in order to allow its usage in other controls
            Theme      theme = ThemeRepository.ControlDefault;
            StyleGroup sg    = theme.FindStyleGroup("Telerik.WinControls.UI.RadDropDownList");

            sg.Registrations.Add(new StyleRegistration("Telerik.WinControls.UI.RadDropDownListArrowButtonElement"));

            indicator           = new RadDropDownListArrowButtonElement();
            indicator.MaxSize   = new System.Drawing.Size(18, 20);
            indicator.Alignment = ContentAlignment.MiddleRight;
            indicator.NotifyParentOnMouseInput = false;
            indicator.Click += indicator_Click;
            this.Children.Add(indicator);
        }
Ejemplo n.º 14
0
        public override void Initialize(GridViewColumn column, GridRowElement row)
        {
            base.Initialize(column, row);

            var height = this.TableElement.GroupHeaderHeight + 8;

            _headerElement.Size    = new Size(this.ViewTemplate.Columns["destinationFolder"].Width, height);
            _progressElement.Size  = new Size(this.ViewTemplate.Columns["progressBar"].Width - 6, height - 6);
            _hasErrorsElement.Size = new Size(this.ViewTemplate.Columns["hasErrors"].Width, height);
            _stack.Size            = new Size(_headerElement.Size.Width + _progressElement.Size.Width + _hasErrorsElement.Size.Width, height);

            _stack.Margin = new Padding(Math.Max(0, 1 - row.RowInfo.HierarchyLevel) * this.TableElement.GroupIndent, 0, 0, 0);

            row.GridControl.Resize +=
                (s, e) =>
            {
                _headerElement.Size    = new Size(this.ViewTemplate.Columns["destinationFolder"].Width, height);
                _progressElement.Size  = new Size(this.ViewTemplate.Columns["progressBar"].Width - 6, height - 6);
                _hasErrorsElement.Size = new Size(this.ViewTemplate.Columns["hasErrors"].Width, height);
                _stack.Size            = new Size(_headerElement.Size.Width + _progressElement.Size.Width + _hasErrorsElement.Size.Width, height);
            };

            _progressElement.Visibility  = row.GridControl.AutoExpandGroups ? ElementVisibility.Hidden : ElementVisibility.Visible;
            _hasErrorsElement.Visibility = row.GridControl.AutoExpandGroups ? ElementVisibility.Hidden : ElementVisibility.Visible;

            row.GridControl.GroupExpanded +=
                (s, e) =>
            {
                var isExpanded = this.RowElement.GridControl != null && RadGridViewHelper.GetGroups(this.RowElement.GridControl.Groups).All(g => g.IsExpanded);

                _progressElement.Visibility  = isExpanded ? ElementVisibility.Hidden : ElementVisibility.Visible;
                _hasErrorsElement.Visibility = isExpanded ? ElementVisibility.Hidden : ElementVisibility.Visible;
            };


            // force grid to honor its AutoExpandGroups property when a group is initialized
            if (row.GridControl.AutoExpandGroups)
            {
                row.Data.Group.Expand();
            }
            else
            {
                row.Data.Group.Collapse();
            }
        }
Ejemplo n.º 15
0
        private void CollapseSetting_AnimationFinished(object sender, AnimationStatusEventArgs e)
        {
            this.OnUpdateViewNeeded(EventArgs.Empty);
            IList <GridRowElement> visualRows = this.TableElement.VisualRows;

            GridExpandAnimationFade.FadeAnimatedPropertySetting animatedPropertySetting1 = sender as GridExpandAnimationFade.FadeAnimatedPropertySetting;
            int rowIndex = animatedPropertySetting1.RowIndex;

            animatedPropertySetting1.AnimationFinished -= new AnimationFinishedEventHandler(this.CollapseSetting_AnimationFinished);
            for (int index = rowIndex; index < visualRows.Count; ++index)
            {
                GridRowElement gridRowElement = visualRows[index];
                if (gridRowElement.Visibility != ElementVisibility.Hidden)
                {
                    GridExpandAnimationFade.FadeAnimatedPropertySetting animatedPropertySetting2 = new GridExpandAnimationFade.FadeAnimatedPropertySetting(VisualElement.OpacityProperty, (object)0.0, (object)1.0, 9, 30);
                    animatedPropertySetting2.RemoveAfterApply = true;
                    animatedPropertySetting2.ApplyValue((RadObject)gridRowElement);
                }
            }
        }
Ejemplo n.º 16
0
        public override void Expand(GridViewRowInfo rowInfo, float maxOffset, int rowIndex)
        {
            IList <GridRowElement> visualRows = this.TableElement.VisualRows;

            for (int index = rowIndex; index < visualRows.Count; ++index)
            {
                GridRowElement gridRowElement = visualRows[index];
                if (gridRowElement.Visibility != ElementVisibility.Hidden)
                {
                    AnimatedPropertySetting animatedPropertySetting = new AnimatedPropertySetting(RadElement.PositionOffsetProperty, (object)new SizeF(0.0f, 0.0f), (object)new SizeF(0.0f, maxOffset), 9, 30);
                    animatedPropertySetting.RemoveAfterApply = true;
                    animatedPropertySetting.ApplyEasingType  = RadEasingType.InQuint;
                    if (index == visualRows.Count - 1)
                    {
                        animatedPropertySetting.AnimationFinished += new AnimationFinishedEventHandler(this.ExpandSetting_AnimationFinished);
                    }
                    animatedPropertySetting.ApplyValue((RadObject)gridRowElement);
                }
            }
        }
Ejemplo n.º 17
0
        public override void Collapse(GridViewRowInfo rowInfo, float maxOffset, int rowIndex)
        {
            IList <GridRowElement> visualRows = this.TableElement.VisualRows;

            for (int index = rowIndex; index < visualRows.Count; ++index)
            {
                GridRowElement gridRowElement = visualRows[index];
                if (gridRowElement.Visibility != ElementVisibility.Hidden)
                {
                    GridExpandAnimationFade.FadeAnimatedPropertySetting animatedPropertySetting = new GridExpandAnimationFade.FadeAnimatedPropertySetting(VisualElement.OpacityProperty, (object)1.0, (object)0.0, 9, 30);
                    animatedPropertySetting.RemoveAfterApply = true;
                    if (index == visualRows.Count - 1)
                    {
                        animatedPropertySetting.AnimationFinished += new AnimationFinishedEventHandler(this.CollapseSetting_AnimationFinished);
                        animatedPropertySetting.RowIndex           = rowIndex;
                    }
                    animatedPropertySetting.ApplyValue((RadObject)gridRowElement);
                }
            }
        }
        public IndicatedBrowseCellElement(GridViewColumn column, GridRowElement row) : base(column, row)
        {
            indicator = new BrowseEditorButton();

            //this code adds a registration for RadDropDownListArrowButtonElement in order to allow its usage in other controls
            Theme      theme = ThemeRepository.ControlDefault;
            StyleGroup sg    = theme.FindStyleGroup("Telerik.WinControls.UI.RadBrowseEditor");

            sg.Registrations.Add(new StyleRegistration("Telerik.WinControls.UI.BrowseEditorButton"));

            indicator.Alignment = ContentAlignment.MiddleRight;
            indicator.ShouldHandleMouseInput   = true;
            indicator.NotifyParentOnMouseInput = false;

            indicator.FitToSizeMode = Telerik.WinControls.RadFitToSizeMode.FitToParentBounds;
            indicator.MaxSize       = new System.Drawing.Size(30, 15);
            indicator.Margin        = new System.Windows.Forms.Padding(0, 1, 4, 1);
            indicator.Click        += indicator_Click;

            this.Children.Add(indicator);
        }
Ejemplo n.º 19
0
        internal static void ReleaseCellElement(
            CellElementProvider cellProvider,
            GridRowElement rowElement,
            GridCellElement cell,
            bool cache)
        {
            GridVirtualizedCellElement virtualizedCellElement = cell as GridVirtualizedCellElement;

            if (virtualizedCellElement != null)
            {
                if (cache)
                {
                    cellProvider.CacheElement((IVirtualizedElement <GridViewColumn>)virtualizedCellElement);
                }
                virtualizedCellElement.Detach();
                rowElement.Children.Remove((RadElement)cell);
            }
            else
            {
                cell.Dispose();
            }
        }
        public IndicatedDecimalCellElement(GridViewColumn column, GridRowElement row) : base(column, row)
        {
            //this code adds a registration for RadDropDownListArrowButtonElement in order to allow its usage in other controls
            Theme      theme = ThemeRepository.ControlDefault;
            StyleGroup sg    = theme.FindStyleGroup("Telerik.WinControls.UI.RadSpinEditor");

            sg.Registrations.Add(new StyleRegistration("Telerik.WinControls.UI.RadSpinElementUpButton"));
            sg.Registrations.Add(new StyleRegistration("Telerik.WinControls.UI.RadSpinElementDownButton"));

            indicatorUP                   = new RadSpinElementUpButton();
            indicatorUP.Class             = "UpButton";
            indicatorUP.Arrow.Direction   = ArrowDirection.Up;
            indicatorUP.StretchVertically = true;
            indicatorUP.Click            += indicator_Click;
            indicatorUP.Tag               = true;

            indicatorDown                   = new RadSpinElementDownButton();
            indicatorDown.Class             = "DownButton";
            indicatorDown.Arrow.Direction   = ArrowDirection.Down;
            indicatorDown.StretchVertically = true;
            indicatorDown.Click            += indicator_Click;
            indicatorDown.Tag               = false;

            StackLayoutElement layout = new StackLayoutElement();

            layout.Orientation         = System.Windows.Forms.Orientation.Vertical;
            layout.Alignment           = System.Drawing.ContentAlignment.MiddleRight;
            layout.StretchHorizontally = false;
            layout.StretchVertically   = true;
            layout.MaxSize             = new System.Drawing.Size(20, 18);
            layout.FitToSizeMode       = RadFitToSizeMode.FitToParentBounds;
            layout.Children.Add(indicatorUP);
            layout.Children.Add(indicatorDown);
            layout.Margin         = new System.Windows.Forms.Padding(0, 1, 4, 1);
            layout.ElementSpacing = 0;

            this.Children.Add(layout);
        }
Ejemplo n.º 21
0
        public void TestMethodSelectionChanged()
        {
            //Arrange
            using (JMRadForm form = new JMRadForm())
            {
                List <Order> orders = form.GetData();
                form.Grid.DataSource = orders;
                form.Grid.ClearSelection();
                form.Grid.CurrentRow  = null;
                form.Grid.MultiSelect = false;
                form.Grid.LoadElementTree();

                //get the middle visual row element
                GridRowElement visualRowElement = form.Grid.TableElement.GetRowElement(form.Grid.Rows[orders.Count / 2]);
                var            rowBehaviorMock  = Mock.Create <GridRowBehavior>(Behavior.CallOriginal);

                Mock.NonPublic.Arrange <IGridBehavior>((BaseGridBehavior)form.Grid.GridBehavior, "GetRowBehaviorAtPoint",
                                                       Arg.Expr.IsAny <Point>()).Returns(((BaseGridBehavior)form.Grid.GridBehavior).GetBehavior(visualRowElement.RowInfo.GetType()));
                Mock.NonPublic.Arrange <GridCellElement>(rowBehaviorMock, "GetCellAtPoint", Arg.Expr.IsAny <Point>()).IgnoreInstance().Returns(visualRowElement.VisualCells[1]);
                Mock.NonPublic.Arrange <GridRowElement>(rowBehaviorMock, "GetRowAtPoint", Arg.Expr.IsAny <Point>()).IgnoreInstance().Returns(visualRowElement);

                string middleRowText = visualRowElement.VisualCells[1].Text;
                string actual        = string.Empty;
                form.Grid.SelectionChanged += (o, e) =>
                {
                    actual = form.Grid.SelectedRows[0].Cells["Id"].Value.ToString();
                };

                //Act
                MouseEventArgs emptyMouseEventArgs = new MouseEventArgs(MouseButtons.Left, 1, 0, 0, 0);
                ((BaseGridBehavior)form.Grid.GridBehavior).OnMouseDown(emptyMouseEventArgs);

                //Assert
                Assert.AreEqual(middleRowText, actual);
            }
        }
Ejemplo n.º 22
0
 public override void Initialize(GridViewColumn column, GridRowElement row)
 {
     base.Initialize(column, row);
     this.ShowSummaryCells = !row.Data.IsExpanded || row.Data.Group.Groups.Count > 0;
 }
 public FastGridViewCheckBoxHeaderCell(GridViewColumn column, GridRowElement row)
     : base(column, row)
 {
 }
 public override void Initialize(GridViewColumn column, GridRowElement row)
 {
     base.Initialize(column, row);
     column.AllowSort = false;
 }
Ejemplo n.º 25
0
 public CustomGroupCellElement(GridViewColumn column, GridRowElement row)
     : base(column, row)
 {
 }
Ejemplo n.º 26
0
 public override void Initialize(GridViewColumn column, GridRowElement row)
 {
     base.Initialize(column, row);
     column.AllowSort = false;
 }
Ejemplo n.º 27
0
 public CheckBoxHeaderCell(GridViewColumn column, GridRowElement row)
     : base(column, row)
 {
 }
 public SpreadsheetGridRowHeaderCellElement(GridViewColumn column, GridRowElement row)
     : base(column, row)
 {
 }
 public override void Initialize(GridViewColumn column, GridRowElement row)
 {
     base.Initialize(column, row);
 }
Ejemplo n.º 30
0
 public MyCombBoxCellElement(GridViewColumn col, GridRowElement row) : base(col, row)
 {
 }
Ejemplo n.º 31
0
 public GridIndentCellElement(GridViewColumn column, GridRowElement row)
     : base(column, row)
 {
 }
Ejemplo n.º 32
0
 public CustomCell(GridViewColumn column, GridRowElement row) : base(column, row)
 {
 }