Example #1
0
        /// <summary>
        /// Returns a DataView based on the <see cref="IBusinessObjectCollection"/> defined by <paramref name="boCol"/>.
        /// The Columns in the <see cref="DataView"/> will be the collumns defined in the Grids <see cref="UiDefName"/>
        /// </summary>
        /// <param name="boCol">The collection that the DataView is based on</param>
        /// <returns></returns>
        protected virtual IBindingListView GetBindingListView(IBusinessObjectCollection boCol)
        {
            DataSetProvider = _gridBase.CreateDataSetProvider(boCol);
            if (this.ClassDef == null || this.ClassDef != _boCol.ClassDef)
            {
                this.ClassDef = _boCol.ClassDef;
            }
            var uiDef = ((ClassDef)this.ClassDef).GetUIDef(UiDefName);

            if (uiDef == null)
            {
                throw new ArgumentException
                          (String.Format
                              ("You cannot Get the data for the grid {0} since the uiDef {1} cannot be found for the classDef {2}",
                              this._gridBase.Name, UiDefName, ((ClassDef)this.ClassDef).ClassName));
            }
            return(DataSetProvider.GetDataView(uiDef.UIGrid));
        }
 /// <summary>
 /// Returns a DataView based on the <see cref="IBusinessObjectCollection"/> defined by <paramref name="boCol"/>.
 /// The Columns in the <see cref="DataView"/> will be the collumns defined in the Grids <see cref="UiDefName"/>
 /// </summary>
 /// <param name="boCol">The collection that the DataView is based on</param>
 /// <returns></returns>
 protected virtual IBindingListView GetBindingListView(IBusinessObjectCollection boCol)
 {
     DataSetProvider = _gridBase.CreateDataSetProvider(boCol);
     if (this.ClassDef == null || this.ClassDef != _boCol.ClassDef)
     {
         this.ClassDef = _boCol.ClassDef;
     }
     var uiDef = ((ClassDef) this.ClassDef).GetUIDef(UiDefName);
     if (uiDef == null)
     {
         throw new ArgumentException
             (String.Format
                  ("You cannot Get the data for the grid {0} since the uiDef {1} cannot be found for the classDef {2}",
                   this._gridBase.Name, UiDefName, ((ClassDef) this.ClassDef).ClassName));
     }
     return DataSetProvider.GetDataView(uiDef.UIGrid);
 }