Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. LINQ
  4. linq, grid paging problem

linq, grid paging problem

Scheduled Pinned Locked Moved LINQ
csharpcssdatabaselinqhelp
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    haseeb_saeed
    wrote on last edited by
    #1

    hi... how would query in linq for: 1. Selecting top 10 rows for a datagrid on the first time... 2. allowing paging in grid and when somebody pressing 2, re- query linq and get next 10 rows ... i am quite knew to paging (manually)...sorry for inconvenience... fellows thanx...

    haseeb

    S 2 Replies Last reply
    0
    • H haseeb_saeed

      hi... how would query in linq for: 1. Selecting top 10 rows for a datagrid on the first time... 2. allowing paging in grid and when somebody pressing 2, re- query linq and get next 10 rows ... i am quite knew to paging (manually)...sorry for inconvenience... fellows thanx...

      haseeb

      S Offline
      S Offline
      SayreCC
      wrote on last edited by
      #2

      Hi, you can try this in your GridView1_IndexC..() GridView1.PageIndex = e.newpageindex(); GridView1.Datasource= dt; Gridview1.Databind(); where your dt is equal to your query in linq. Hope this one can help Thanks

      1 Reply Last reply
      0
      • H haseeb_saeed

        hi... how would query in linq for: 1. Selecting top 10 rows for a datagrid on the first time... 2. allowing paging in grid and when somebody pressing 2, re- query linq and get next 10 rows ... i am quite knew to paging (manually)...sorry for inconvenience... fellows thanx...

        haseeb

        S Offline
        S Offline
        SayreCC
        wrote on last edited by
        #3

        Hi, if you can sub procedure for calling to load your grid, you can call it again after you clicked the paging. in your grid_pagingidex something like this grid1.pageindex = e.newpageindex; grid1.datasource = (var q = from a in dc.gettable(); grid1.databind();

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups