示例#1
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);
            }
示例#2
0
            public override void SetContent()
            {
                base.SetContent();
                this.TextAlignment    = ContentAlignment.TopLeft;
                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]);
                    index += 1;

                    if (this.ViewTemplate.Columns[column.Key].IsGrouped && this.ViewTemplate.ShowGroupedColumns == false)
                    {
                        element.Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
                    }
                    else
                    {
                        element.Visibility = Telerik.WinControls.ElementVisibility.Visible;
                        element.Text       = column.Value;
                    }
                }
            }