Exemplo n.º 1
0
        /// <summary>
        /// Binds the grid for defined values.
        /// </summary>
        /// <param name="typeId">The type id.</param>
        protected void rGridValue_Bind( string typeId )
        {
            int definedTypeId = Int32.Parse( typeId );

            var queryable = new DefinedValueService().Queryable().
                Where( a => a.DefinedTypeId == definedTypeId );

            SortProperty sortProperty = rGridValue.SortProperty;
            if ( sortProperty != null )
                queryable = queryable.
                    Sort( sortProperty );
            else
                queryable = queryable.
                    OrderBy( a => a.Id);

            rGridValue.DataSource = queryable.ToList();

            rGridValue.DataBind();
        }