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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. GridView column value needs to be in Order and sequence

GridView column value needs to be in Order and sequence

Scheduled Pinned Locked Moved ASP.NET
csharpquestionasp-nethelp
5 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.
  • C Offline
    C Offline
    codingrocks
    wrote on last edited by
    #1

    Gridview having some values say column1 have name and column2 have empid. I need to check all this empids and make sure that they start from 1 and are in order. No number is missed out in middle. If missed out, then an alert should be shown that saying the order is not proper. Any help please..... I have the values in Dataset but, how can i show the alert in asp.net ?

    SAJAN A PILLAI ASP.NET,C#.NET Programmer BANGALORE "Winners don't do different things. They do things differently. ...

    B C C 3 Replies Last reply
    0
    • C codingrocks

      Gridview having some values say column1 have name and column2 have empid. I need to check all this empids and make sure that they start from 1 and are in order. No number is missed out in middle. If missed out, then an alert should be shown that saying the order is not proper. Any help please..... I have the values in Dataset but, how can i show the alert in asp.net ?

      SAJAN A PILLAI ASP.NET,C#.NET Programmer BANGALORE "Winners don't do different things. They do things differently. ...

      B Offline
      B Offline
      Brij
      wrote on last edited by
      #2

      For showing an alert you have only option to use Javascript alert you can register it for the alert message and for checking the proper sequence you can check it in RowDataBound event.

      Cheers!! Brij

      1 Reply Last reply
      0
      • C codingrocks

        Gridview having some values say column1 have name and column2 have empid. I need to check all this empids and make sure that they start from 1 and are in order. No number is missed out in middle. If missed out, then an alert should be shown that saying the order is not proper. Any help please..... I have the values in Dataset but, how can i show the alert in asp.net ?

        SAJAN A PILLAI ASP.NET,C#.NET Programmer BANGALORE "Winners don't do different things. They do things differently. ...

        C Offline
        C Offline
        codingrocks
        wrote on last edited by
        #3

        I have tried this code.....can you suggest anything else... protected void gvCRMODField_RowDataBound(object sender, GridViewRowEventArgs e) { GridViewRow gvCRMOD = gvCRMODField.Rows; if (gvCRMOD.Cells[2].Text != null) { ///Logic here } } I cannot find any method......please help me....

        SAJAN A PILLAI ASP.NET,C#.NET Programmer BANGALORE "Winners don't do different things. They do things differently. ...

        B 1 Reply Last reply
        0
        • C codingrocks

          Gridview having some values say column1 have name and column2 have empid. I need to check all this empids and make sure that they start from 1 and are in order. No number is missed out in middle. If missed out, then an alert should be shown that saying the order is not proper. Any help please..... I have the values in Dataset but, how can i show the alert in asp.net ?

          SAJAN A PILLAI ASP.NET,C#.NET Programmer BANGALORE "Winners don't do different things. They do things differently. ...

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          sajan ss wrote:

          ASP.NET,C#.NET Programmer

          This appears increasingly unlikely to me. If you're telling the user that the data they entered is invalid, you can use a custom validator, or you can use an alert. If you're checking the data in the DB, you can just use a label. Is the user entering data ? If so, just reject data that doesn't follow your rules. Hell, it's fundamentally broken that you have such a rule and you don't just auto generate the ids according to the rule set.

          Christian Graus Driven to the arms of OSX by Vista.

          1 Reply Last reply
          0
          • C codingrocks

            I have tried this code.....can you suggest anything else... protected void gvCRMODField_RowDataBound(object sender, GridViewRowEventArgs e) { GridViewRow gvCRMOD = gvCRMODField.Rows; if (gvCRMOD.Cells[2].Text != null) { ///Logic here } } I cannot find any method......please help me....

            SAJAN A PILLAI ASP.NET,C#.NET Programmer BANGALORE "Winners don't do different things. They do things differently. ...

            B Offline
            B Offline
            Brij
            wrote on last edited by
            #5

            take a varaible in viewstate.increase it one by one and check from the actual value like object temp = DataBinder.Eval(e.Row.DataItem, "empid"); and check it temp from the viewstate's value if flase register an javascript alert.

            Cheers!! Brij

            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