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. Web Development
  3. ASP.NET
  4. Sr No in GridView

Sr No in GridView

Scheduled Pinned Locked Moved ASP.NET
question
4 Posts 3 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.
  • V Offline
    V Offline
    varshavmane
    wrote on last edited by
    #1

    Hi All, I need to display Sr No in GridView, in dataset I dont have Sr No column.Please tell me how do I do this... Thanks in advance...

    T 1 Reply Last reply
    0
    • V varshavmane

      Hi All, I need to display Sr No in GridView, in dataset I dont have Sr No column.Please tell me how do I do this... Thanks in advance...

      T Offline
      T Offline
      Tirthadip
      wrote on last edited by
      #2

      two things can be done... 1.Make an Autogenerate column in your Database table if your query doesnt include any JOINING......i.e if you are fetching record from 1 table.... 2.If the case is not so...then u have to make 1 column in your DataSet table ....i.e u have to make a customized dataset from your existing dataset.....

      Tirtha Miles to go before I sleep

      V 1 Reply Last reply
      0
      • T Tirthadip

        two things can be done... 1.Make an Autogenerate column in your Database table if your query doesnt include any JOINING......i.e if you are fetching record from 1 table.... 2.If the case is not so...then u have to make 1 column in your DataSet table ....i.e u have to make a customized dataset from your existing dataset.....

        Tirtha Miles to go before I sleep

        V Offline
        V Offline
        varshavmane
        wrote on last edited by
        #3

        Hi Tritha, Thanks for Reply.First case I cant use because if few rows are deleted then its will show me sr no as 1 2 4 5 etc. But I think I can use second option.Can u please help me with the code.I am using ASP.NET 2.0(VB) or is there any way we can do it with Query Thanks...

        N 1 Reply Last reply
        0
        • V varshavmane

          Hi Tritha, Thanks for Reply.First case I cant use because if few rows are deleted then its will show me sr no as 1 2 4 5 etc. But I think I can use second option.Can u please help me with the code.I am using ASP.NET 2.0(VB) or is there any way we can do it with Query Thanks...

          N Offline
          N Offline
          Nicejith
          wrote on last edited by
          #4

          Put column in datagrid -------------------- ------------------------------------ write in code behind page public string sn1() { int t; i = i + 1; t = (grd_category.CurrentPageIndex * pagesize) + i; return t.ToString(); } DataGridPageChangedEventArgs e) { grd_category.CurrentPageIndex =e.NewPageIndex; bind();//code to bind the grid } hope this would help you..

          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