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. C#
  4. To insert Validation in DataGridView

To insert Validation in DataGridView

Scheduled Pinned Locked Moved C#
databasetutorial
9 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.
  • A Offline
    A Offline
    annie_bel
    wrote on last edited by
    #1

    hi! In windows application, i am using datagridview to insert value into database. But i want put some validation in certain column. but i couldn't.

    eg.: i have two columns namely,
    Description and Cost. I want to insert only capital letters in Description column and only numbers in cost column.

    plz guide me an idea. i will appreciate for it. thanx and regards

    S 1 Reply Last reply
    0
    • A annie_bel

      hi! In windows application, i am using datagridview to insert value into database. But i want put some validation in certain column. but i couldn't.

      eg.: i have two columns namely,
      Description and Cost. I want to insert only capital letters in Description column and only numbers in cost column.

      plz guide me an idea. i will appreciate for it. thanx and regards

      S Offline
      S Offline
      Shuaib wasif khan
      wrote on last edited by
      #2

      set character casing toupper

      A 1 Reply Last reply
      0
      • S Shuaib wasif khan

        set character casing toupper

        A Offline
        A Offline
        annie_bel
        wrote on last edited by
        #3

        cn u tell me where i use this code

        S 1 Reply Last reply
        0
        • A annie_bel

          cn u tell me where i use this code

          S Offline
          S Offline
          Shuaib wasif khan
          wrote on last edited by
          #4

          bind it to textbox column and use text box character casing property

          A 1 Reply Last reply
          0
          • S Shuaib wasif khan

            bind it to textbox column and use text box character casing property

            A Offline
            A Offline
            annie_bel
            wrote on last edited by
            #5

            thanx monu! one more question i want to ask. i use menustrip and this contain two sub menu. my query is when i click first sub menu , the DataGridView will open and some character are displayed in first column.

            e.g.: menustrip contain Course and subject. when i click course link the DataGridView will open and "crse" are shown in first column of datagridview. Same condition apply with "Subject".

            can u give some idea. again thanx

            S 1 Reply Last reply
            0
            • A annie_bel

              thanx monu! one more question i want to ask. i use menustrip and this contain two sub menu. my query is when i click first sub menu , the DataGridView will open and some character are displayed in first column.

              e.g.: menustrip contain Course and subject. when i click course link the DataGridView will open and "crse" are shown in first column of datagridview. Same condition apply with "Subject".

              can u give some idea. again thanx

              S Offline
              S Offline
              Shuaib wasif khan
              wrote on last edited by
              #6

              are u fetching data from database or what. if that is the case you can use sql query according to the criteria and bind them with gridview

              A 1 Reply Last reply
              0
              • S Shuaib wasif khan

                are u fetching data from database or what. if that is the case you can use sql query according to the criteria and bind them with gridview

                A Offline
                A Offline
                annie_bel
                wrote on last edited by
                #7

                no, actually i use this on insert command. so, thre is no data in database. i want use maybe "HardCode".

                S 1 Reply Last reply
                0
                • A annie_bel

                  no, actually i use this on insert command. so, thre is no data in database. i want use maybe "HardCode".

                  S Offline
                  S Offline
                  Shuaib wasif khan
                  wrote on last edited by
                  #8

                  do you mean that you want to insert data through gridview plz explain your problem

                  N 1 Reply Last reply
                  0
                  • S Shuaib wasif khan

                    do you mean that you want to insert data through gridview plz explain your problem

                    N Offline
                    N Offline
                    Nikhil Bhivgade
                    wrote on last edited by
                    #9

                    their is an event on endedit of Datagridview on which you can work on to get ur results

                    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