You must Sign In to post a response.
  • Category: .NET

    How to set only 10 rows per datagridview in .net winforms

    How to set only 10 rows per datagridview in .net winforms
  • #619402

    Try the folloeing code

    <asp:gridview id="Employee"


    Rajesh Kumar Parbat

  • #619412 its ok
    I am asking Windows Application

  • #619453
    We have to use PageSize property for Windows application also.

    customDataGrid1.PageSize = 10; customDataGrid1.DataSource = data; customDataGrid1.BindGrid();

  • #619463
    Hi Saravanan,

    You are right that we dont have inbuild functionality for the pagesize in windows application.
    for this we need to write our own custom code which will do tht navigation based on our requirements.
    so the first tig is we need to declare the pagesie variable and how many records we want in a page e.g. 10
    Then we need to create a fucntion which will take these two as parameter and based on these parameter it will fetch the records from the database.

    For the full code refernce follwo the below post which already explain about this:

    Pawan Awasthi(DNS MVM)
    +91 8123489140 (whatsApp), +60 14365 1476(Malaysia)

  • #619491
    Hi check this

    private void Dgv_display()
    dataGridView1.AllowUserToAddRows = false;
    dataGridView1.AllowUserToDeleteRows = false;
    catch (Exception ex)


  • This thread is locked for new responses. Please post your comments and questions as a separate thread.
    If required, refer to the URL of this page in your new post.