Beispiel #1
0
        void AddColumnToGridBand(GridBand gridBand, IModelGridBand modelGridBand)
        {
            var bandedModelColumns = Control.Model.Columns.GetVisibleColumns().OfType <IModelColumnOptionsAdvBandedView>().Where(column => column.GridBand != null && GetBandName(column.GridBand) == GetBandName(modelGridBand));
            var columns            = bandedModelColumns.OrderBy(view => view.OptionsColumnAdvBandedView.GetValue <int>("RowVIndex")).ThenBy(view => view.OptionsColumnAdvBandedView.GetValue <int>("ColVIndex"));

            foreach (var modelColumn in columns)
            {
                var bandedGridColumn = FindBandedGridColumn(modelColumn);
                if (bandedGridColumn != null)
                {
                    bandedGridColumn.OwnerBand = gridBand;
                    gridBand.Columns.Add(bandedGridColumn);
                }
            }
        }
Beispiel #2
0
        GridBand GetGridBand(IModelGridBand modelGridBand, GridBandCollection bandCollection)
        {
            var gridBand = FindGridBand(modelGridBand);

            if (gridBand == null)
            {
                gridBand = new GridBand(modelGridBand)
                {
                    Name = GetBandName(modelGridBand)
                };
                bandCollection.Add(gridBand);
                gridBand.Visible = modelGridBand.Index > -1;
            }
            ApplyModel(modelGridBand, gridBand, ApplyValues);
            return(gridBand);
        }
Beispiel #3
0
 public GridBand(IModelGridBand modelGridBand) {
     _modelGridBand = modelGridBand;
 }
Beispiel #4
0
 public GridBand(IModelGridBand modelGridBand)
 {
     _modelGridBand = modelGridBand;
 }
Beispiel #5
0
 string GetBandName(IModelGridBand modelGridBand)
 {
     return(modelGridBand.GetValue <string>("Id"));
 }
Beispiel #6
0
        GridBand FindGridBand(IModelGridBand modelGridBand)
        {
            var gridBands = Control.GridView.Bands.GetItems <GridBand>(band => band.Children);

            return(gridBands.FirstOrDefault(band => band.ModelGridBand == modelGridBand));
        }