Exemplo n.º 1
0
        private void LoadData()
        {
            // using (DataPagingBL bl = new DataPagingBL())
            {
                DataPagingBL bl = new DataPagingBL();
                searchModel.SortBy        = nameof(ELMAH_Error.Type);
                searchModel.SortDirection = "DESC";
                //searchModel.PageNum = pageCurrent;
                //searchModel.PageSize = pageSize;
                //searchModel.PageSkip

                //改写控件时,只需将search model传给user control
                List <ELMAH_Error> ls = bl.GetElmahErrorLog(searchModel);


                this.bindingSource1.DataSource       = ls;
                this.bindingNavigator1.BindingSource = this.bindingSource1;
                this.gridControl1.DataSource         = this.bindingSource1;

                this.lblCurrentPage.Text      = "当前页:" + searchModel.PageNum.ToString();
                this.lblTotalPage.Text        = "总页数:" + searchModel.TotalPage.ToString();
                this.lblPageSize.Text         = "每页记录数:" + searchModel.PageSize.ToString();
                this.lblTotalRecordCount.Text = "总记录数:" + searchModel.RecordCount.ToString();
                this.txtJumpTo.Text           = searchModel.PageNum.ToString();
            }
        }
        private void LoadData()
        {
            DataPagingBL bl = new DataPagingBL();

            searchModel.SortBy        = nameof(ELMAH_Error.Type);
            searchModel.SortDirection = "DESC";

            //searchModel.PageNum = pageCurrent;
            //searchModel.PageSize = pageSize;
            //searchModel.PageSkip

            //改写控件时,只需将search model传给user control
            //此方法现在用的是EF,也可以改成用存储过程,参考https://blog.csdn.net/david_520042/article/details/50675645
            List <ELMAH_Error> ls = bl.GetElmahErrorLog(searchModel);

            this.ucPager1.RefreshPager <ELMAH_Error>(this.gridControl1, ls, searchModel);

            //this.gridControl1.DataSource = this.ucPager1.GetBindingSource();
        }
        private void LoadData()
        {
            // using (DataPagingBL bl = new DataPagingBL())
            {
                DataPagingBL bl = new DataPagingBL();
                searchModel.SortBy        = nameof(ELMAH_Error.Type);
                searchModel.SortDirection = "DESC";
                //searchModel.PageNum = pageCurrent;
                //searchModel.PageSize = pageSize;
                //searchModel.PageSkip

                //改写控件时,只需将search model传给user control
                List <ELMAH_Error> ls = bl.GetElmahErrorLog(searchModel);

                this.gridControl1.DataSource = ls;
                this.gridView1.OptionsCustomization.AllowRowSizing = true; //行可再设高

                //this.gridView1.CanResizeRow = true;
                //for (int i = 0; i < this.gridView1.RowCount; i++)
                {
                    this.repositoryItemMemoExEdit1.ShowIcon = false;
                    gridView1.Columns["Message"].ColumnEdit = this.repositoryItemMemoExEdit1;
                    this.gridControl1.RepositoryItems.Add(this.repositoryItemMemoExEdit1);

                    gridView1.Columns["Type"].ColumnEdit = this.repositoryItemMemoEdit1;
                    this.gridControl1.RepositoryItems.Add(this.repositoryItemMemoEdit1);

                    var popupContainerControl = new PopupContainerControl();
                    popupContainerControl.Controls.Add(new TextBox());
                    this.repositoryItemPopupContainerEdit1.PopupControl = popupContainerControl;
                    gridView1.Columns["Application"].ColumnEdit         = this.repositoryItemPopupContainerEdit1;
                    this.gridControl1.RepositoryItems.Add(this.repositoryItemPopupContainerEdit1);

                    gridView1.Columns["Host"].ColumnEdit = this.repositoryItemRichTextEdit1;
                    this.gridControl1.RepositoryItems.Add(this.repositoryItemRichTextEdit1);

                    gridView1.Columns["Source"].ColumnEdit = this.repositoryItemTextEdit1;
                    this.gridControl1.RepositoryItems.Add(this.repositoryItemTextEdit1);
                }
            }
        }