using Paging in Datagrid

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default using Paging in Datagrid

    Hi,
    I am adding a paging function to a datagrid control, the datasource is a
    DataSet Object. Based on some articles, I just add some attributes to
    datagrid, ie.
    Allowpaging=true,Pagesize=5,PagerStyle-Mode="numbericPages",
    it is nice that it worked , page index appeared.
    But when I clicked the page index,no paging effect appeared, on the web
    page is the same record as the first view.

    I got some conflicting instruction on this,some say u just need add some
    attrubutes,since the datagrid support paging itself, while other say u still
    need
    add some sub for an event on PageindexChanged and rebind the new data again.

    who is right? since it support paging,why Can't I use it by just adding
    some paging attributes.

    Thanx
    Yangtsi


    Yangtsi River Guest

  2. Similar Questions and Discussions

    1. DataGrid paging
      DataGrid in Asp.NET, i want to ask if it's possible to set paging appear both in left and right bottom in datagrid. eg fieldA fieldB ...
    2. DataGrid and Paging
      Hello Masters! Anyone can help me with the datagrid, well, the app load a lot of data from DB and it show on the datagrid, and well, I need to...
    3. Paging a datagrid
      Please, i've created a datagrid that allow numbered paging. But when i click over a page that must be called, i get this error: ...
    4. DataGrid Paging??
      I have code that builds a dataset and connects it to a datagrid. I set up paging but something is broke. I can do a pagecount property and it...
    5. First Datagrid row with paging
      Hi, My Datagrid header is a shoe size range and depends on the first datagrid row - first article size range. So, i need to get the first row...
  3. #2

    Default Re: using Paging in Datagrid

    on the PageIndexChanged event, add the following line of codes

    dataGrid1.currentPageIndex = e.NewPageIndex
    dataAdapter1.Fill(myDataset)

    dim dv as new DataView
    dv = myDataset.Tables(0).DefaultView
    dv.sort = e.SortExpression

    dataGrid1.dataSource = dv
    dataGrid1.dataBind()



    "Yangtsi River" <nakhi@sina.com> wrote in message
    news:u%23j3pScRDHA.2144@TK2MSFTNGP11.phx.gbl...
    > Hi,
    > I am adding a paging function to a datagrid control, the datasource is a
    > DataSet Object. Based on some articles, I just add some attributes to
    > datagrid, ie.
    > Allowpaging=true,Pagesize=5,PagerStyle-Mode="numbericPages",
    > it is nice that it worked , page index appeared.
    > But when I clicked the page index,no paging effect appeared, on the web
    > page is the same record as the first view.
    >
    > I got some conflicting instruction on this,some say u just need add some
    > attrubutes,since the datagrid support paging itself, while other say u
    still
    > need
    > add some sub for an event on PageindexChanged and rebind the new data
    again.
    >
    > who is right? since it support paging,why Can't I use it by just adding
    > some paging attributes.
    >
    > Thanx
    > Yangtsi
    >
    >

    Benjie Fallar Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139