Ejemplo n.º 1
0
        private void FillGrid()
        {
            dataGridView1.Rows.Clear();

            List <User> users = m_userBLL.GetByParam("", (m_curPage - 1) * ROWS, ROWS, "userID", "asc", "", ref m_total);

            foreach (User user in users)
            {
                int index = dataGridView1.Rows.Add();
                dataGridView1.Rows[index].Cells[0].Value = user.userID;
                dataGridView1.Rows[index].Cells[1].Value = user.name;
                dataGridView1.Rows[index].Cells[2].Value = user.sex;
                dataGridView1.Rows[index].Cells[3].Value = user.age;
                dataGridView1.Rows[index].Cells[4].Value = user.cityNo;
                dataGridView1.Rows[index].Cells[5].Value = user.summary;
            }

            txtPageNo.Text  = m_curPage.ToString();
            txtPageSum.Text = (m_total / ROWS + 1).ToString();
            txtPageNum.Text = ROWS.ToString();
        }