Ejemplo n.º 1
0
        private void AddGrid()
        {
            RadGrid1    = new RadGrid();
            RadGrid1.ID = InstanceType;
            int pageSize = WebContext.Current.ApplicationOption.GridPageSize;

            if (GridPageSize.HasValue)
            {
                pageSize = GridPageSize.Value;
            }
            RadGridHelper.SetStyle(RadGrid1, pageSize);

            RadGrid1.MasterTableView.AllowFilteringByColumn = AllowFilteringByColumn;
            if (IsGridInFormEdit)
            {
                RadGrid1.MasterTableView.EditMode = GridEditMode.EditForms;
                RadGrid1.MasterTableView.EditFormSettings.ColumnNumber = WebContext.Current.ApplicationOption.EditFormColumnMax;
            }

            RadGrid1.NeedDataSource += new GridNeedDataSourceEventHandler(RadGrid1_NeedDataSource);
            RadGrid1.UpdateCommand  += new GridCommandEventHandler(RadGrid1_UpdateCommand);
            RadGrid1.InsertCommand  += new GridCommandEventHandler(RadGrid1_InsertCommand);
            RadGrid1.ItemDataBound  += new GridItemEventHandler(RadGrid1_ItemDataBound);
            RadGrid1.DeleteCommand  += new GridCommandEventHandler(RadGrid1_DeleteCommand);
            RadGrid1.ItemCommand    += new GridCommandEventHandler(RadGrid1_ItemCommand);
            RadGrid1.PreRender      += new EventHandler(RadGrid1_PreRender);

            DefineColumns();
            PlaceHolder1.Controls.Add(RadGrid1);
        }
Ejemplo n.º 2
0
 private void InitGridView()
 {
     RadGridHelper.SetStyle(gvList, PageSize);
     gvList.AutoGenerateColumns = IsAutoGenerateColumns;
     gvList.ClientSettings.Scrolling.AllowScroll = AllowScroll;
 }