/// <summary>
 /// Initializes the page and the controller for the specified type.
 /// </summary>
 /// <param name="type"></param>
 /// <param name="isPaged"></param>
 public void Initialize(Type type, bool isPaged)
 {
     Command = new IndexCommandInfo(type.Name);
     controller = IndexController.New(this);
 }
        /// <summary>
        /// Initializes the page and the controller for the specified type.
        /// </summary>
        /// <param name="type"></param>
        /// <param name="isPaged"></param>
        public void Initialize(Type type, IndexGrid indexGrid, bool isPaged)
        {
            Command = new IndexCommandInfo(type.Name);

            Grid = indexGrid;
            controller = IndexController.New(this,
                                             new PagingLocation(Grid.CurrentPageIndex, Grid.PageSize));

            Grid.SortCommand += new DataGridSortCommandEventHandler(Grid_SortCommand);
            Grid.PageIndexChanged += new DataGridPageChangedEventHandler(Grid_PageIndexChanged);
            SortExpression = indexGrid.CurrentSort;
        }