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. generating serial number in datagrid

generating serial number in datagrid

Scheduled Pinned Locked Moved ASP.NET
help
9 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.
  • I Offline
    I Offline
    Imthu
    wrote on last edited by
    #1

    hai all, i would like to generate autogenerate serial number in datagrid... can anyone help me with this.. its too urgent .. plz

    with Regards, Imthiyas Ahamed.A

    S 1 Reply Last reply
    0
    • I Imthu

      hai all, i would like to generate autogenerate serial number in datagrid... can anyone help me with this.. its too urgent .. plz

      with Regards, Imthiyas Ahamed.A

      S Offline
      S Offline
      Sylvester george
      wrote on last edited by
      #2

      hi buddy, You know the page size and page number where you are on the datagrid. then whats the problem to generate page numbers. anyway you start from the first page so you can put serial number from 1 * 10 - 9 to 1 * 10. when you move to 3rd page it would be 3*10-9 to 3*10 I assume Page size as 10 you can add a label control as template and do this in itemdatabound all the best

      Regards, Sylvester G Senior Software Engineer Xoriant Solutions sylvester_g_m@yahoo.com

      I 1 Reply Last reply
      0
      • S Sylvester george

        hi buddy, You know the page size and page number where you are on the datagrid. then whats the problem to generate page numbers. anyway you start from the first page so you can put serial number from 1 * 10 - 9 to 1 * 10. when you move to 3rd page it would be 3*10-9 to 3*10 I assume Page size as 10 you can add a label control as template and do this in itemdatabound all the best

        Regards, Sylvester G Senior Software Engineer Xoriant Solutions sylvester_g_m@yahoo.com

        I Offline
        I Offline
        Imthu
        wrote on last edited by
        #3

        hai, Thanks For ur reply.... But i am not using paging.. i am using scroll bar with fixed header in my datagrid....So, Is there anyother way to do for this???

        with Regards, Imthiyas Ahamed.A

        S 1 Reply Last reply
        0
        • I Imthu

          hai, Thanks For ur reply.... But i am not using paging.. i am using scroll bar with fixed header in my datagrid....So, Is there anyother way to do for this???

          with Regards, Imthiyas Ahamed.A

          S Offline
          S Offline
          Sylvester george
          wrote on last edited by
          #4

          Are you showing all the records in one page ? if yes then its simple page number is from 1 to number of records

          Regards, Sylvester G Senior Software Engineer Xoriant Solutions sylvester_g_m@yahoo.com

          I 1 Reply Last reply
          0
          • S Sylvester george

            Are you showing all the records in one page ? if yes then its simple page number is from 1 to number of records

            Regards, Sylvester G Senior Software Engineer Xoriant Solutions sylvester_g_m@yahoo.com

            I Offline
            I Offline
            Imthu
            wrote on last edited by
            #5

            k....... but i am using a search page in my project it should bind after checking the condition.... Is it possible sir????

            with Regards, Imthiyas Ahamed.A

            S 1 Reply Last reply
            0
            • I Imthu

              k....... but i am using a search page in my project it should bind after checking the condition.... Is it possible sir????

              with Regards, Imthiyas Ahamed.A

              S Offline
              S Offline
              Sylvester george
              wrote on last edited by
              #6

              yes. Try it out. Or Just paste some of your code snippet here. I will check it out

              Regards, Sylvester G Senior Software Engineer Xoriant Solutions sylvester_g_m@yahoo.com

              I 1 Reply Last reply
              0
              • S Sylvester george

                yes. Try it out. Or Just paste some of your code snippet here. I will check it out

                Regards, Sylvester G Senior Software Engineer Xoriant Solutions sylvester_g_m@yahoo.com

                I Offline
                I Offline
                Imthu
                wrote on last edited by
                #7

                SqlConnection con=new SqlConnection(s); SqlCommand cmd=new SqlCommand ("Sp_search",con); cmd.CommandType =CommandType.StoredProcedure ; cmd.Parameters.Add ("@cname",DblCname.SelectedItem.Text.ToString()); SqlDataAdapter ADA=new SqlDataAdapter(); ADA.SelectCommand =cmd; DataSet Ds=new DataSet(); ADA.Fill(Ds); if (Ds.Tables[0].Rows.Count!=0) { DataGrid1.DataSource=Ds; DataGrid1.DataBind(); DataGrid2.DataSource=Ds; DataGrid2.DataBind(); } else { }

                with Regards, Imthiyas Ahamed.A

                S 1 Reply Last reply
                0
                • I Imthu

                  SqlConnection con=new SqlConnection(s); SqlCommand cmd=new SqlCommand ("Sp_search",con); cmd.CommandType =CommandType.StoredProcedure ; cmd.Parameters.Add ("@cname",DblCname.SelectedItem.Text.ToString()); SqlDataAdapter ADA=new SqlDataAdapter(); ADA.SelectCommand =cmd; DataSet Ds=new DataSet(); ADA.Fill(Ds); if (Ds.Tables[0].Rows.Count!=0) { DataGrid1.DataSource=Ds; DataGrid1.DataBind(); DataGrid2.DataSource=Ds; DataGrid2.DataBind(); } else { }

                  with Regards, Imthiyas Ahamed.A

                  S Offline
                  S Offline
                  Sylvester george
                  wrote on last edited by
                  #8

                  yes you can do it Item DataBound event

                  Regards, Sylvester G Senior Software Engineer Xoriant Solutions sylvester_g_m@yahoo.com

                  I 1 Reply Last reply
                  0
                  • S Sylvester george

                    yes you can do it Item DataBound event

                    Regards, Sylvester G Senior Software Engineer Xoriant Solutions sylvester_g_m@yahoo.com

                    I Offline
                    I Offline
                    Imthu
                    wrote on last edited by
                    #9

                    ok thank u So much.....

                    with Regards, Imthiyas Ahamed.A

                    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