Exemple #1
0
        public override void SetContent()
        {
            base.SetContent();

            this.ShowSummaryCells = !this.RowInfo.Group.IsExpanded || this.RowInfo.Group.Groups.Count > 0;

            GridViewGroupRowInfo rowInfo = (GridViewGroupRowInfo)this.RowInfo;

            if (rowInfo.Parent is GridViewGroupRowInfo && !((GridViewGroupRowInfo)rowInfo.Parent).IsExpanded)
            {
                return;
            }

            Dictionary <string, string> values = this.GetSummaryValues();
            int index = 0;

            foreach (KeyValuePair <string, string> column in values)
            {
                SummaryCellElement element = ((SummaryCellElement)this.stack.Children[index++]);

                if (this.ViewTemplate.Columns[column.Key].IsGrouped)
                {
                    element.Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
                }
                else
                {
                    element.Visibility = Telerik.WinControls.ElementVisibility.Visible;
                    element.Text       = column.Value;
                }
            }
        }
Exemple #2
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;

            for (int i = 0; i < row.RowInfo.Cells.Count; i++)
            {
                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;
                this.stack.Children.Add(element);
            }

            this.Children.Add(this.stack);
        }