Beispiel #1
0
        private void bindingSource1_CurrentChanged(object sender, EventArgs e)
        {
            this.Invoke(new MethodInvoker(delegate
            {
                // The desired page has changed, so fetch the page of records using the "Current" offset
                int total;
                int pageNum = (int)bs.Position > 0 ? (int)bs.Position : 0;

                var lst = _assessmentService.GetAllAssessment(pageSize, pageNum, out total);
                if (lst.Count > 0)
                {
                    dgvAssessment.DataSource = lst;
                }
                else if (pageNum > 1)
                {
                    bs.Position   = pageNum - 1;
                    bs.DataSource = new PageOffsetList(pageSize, total);
                }
            }));
        }