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. General Programming
  3. C#
  4. how to write a number in a cell

how to write a number in a cell

Scheduled Pinned Locked Moved C#
tutorialquestion
10 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.
  • F Offline
    F Offline
    faladrim
    wrote on last edited by
    #1

    lo, i want to change a number in a certain cell i thought i coud change it with a for loop and i found that i can select a cell with datagridview[columnindex,rowindex] so i thought that this would work: datagridview[3,2].value=x.tostring(); //x is a int from the for loop but it doesnt, anybody ideess ??? plzzzz

    S 1 Reply Last reply
    0
    • F faladrim

      lo, i want to change a number in a certain cell i thought i coud change it with a for loop and i found that i can select a cell with datagridview[columnindex,rowindex] so i thought that this would work: datagridview[3,2].value=x.tostring(); //x is a int from the for loop but it doesnt, anybody ideess ??? plzzzz

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

      YOU CAN USE SIMPLY IT WILL CHANGE THE DESIRED VALUE WITH YOU VALUE DATAGRID[ROW,COLUM]="YOUR TEXT";

      sikandar

      F 1 Reply Last reply
      0
      • S sikandarhayat

        YOU CAN USE SIMPLY IT WILL CHANGE THE DESIRED VALUE WITH YOU VALUE DATAGRID[ROW,COLUM]="YOUR TEXT";

        sikandar

        F Offline
        F Offline
        faladrim
        wrote on last edited by
        #3

        when i write datagridview2[3,2]= "this is text"; i get an error Cannot implicitly convert type 'string' to 'System.Windows.Forms.DataGridViewCell'

        A 1 Reply Last reply
        0
        • F faladrim

          when i write datagridview2[3,2]= "this is text"; i get an error Cannot implicitly convert type 'string' to 'System.Windows.Forms.DataGridViewCell'

          A Offline
          A Offline
          albCode
          wrote on last edited by
          #4

          datagridview2.Rows[3].Cells[2].Value.ToString()= "this is text";

          F 1 Reply Last reply
          0
          • A albCode

            datagridview2.Rows[3].Cells[2].Value.ToString()= "this is text";

            F Offline
            F Offline
            faladrim
            wrote on last edited by
            #5

            it works :p first not but now it does ;) thxx

            A 1 Reply Last reply
            0
            • F faladrim

              it works :p first not but now it does ;) thxx

              A Offline
              A Offline
              albCode
              wrote on last edited by
              #6

              Never mind dude ;)

              S 1 Reply Last reply
              0
              • A albCode

                Never mind dude ;)

                S Offline
                S Offline
                sikandarhayat
                wrote on last edited by
                #7

                answer my combo question then i will not mind thanks:)

                sikandar

                A 1 Reply Last reply
                0
                • S sikandarhayat

                  answer my combo question then i will not mind thanks:)

                  sikandar

                  A Offline
                  A Offline
                  albCode
                  wrote on last edited by
                  #8

                  which is ur question???????

                  S 1 Reply Last reply
                  0
                  • A albCode

                    which is ur question???????

                    S Offline
                    S Offline
                    sikandarhayat
                    wrote on last edited by
                    #9

                    right below you question if u can and try ur self how to do some items of combobox will be bold and some are regular. ??? i willbe greatfull.

                    sikandar

                    A 1 Reply Last reply
                    0
                    • S sikandarhayat

                      right below you question if u can and try ur self how to do some items of combobox will be bold and some are regular. ??? i willbe greatfull.

                      sikandar

                      A Offline
                      A Offline
                      albCode
                      wrote on last edited by
                      #10

                      Check this[^]

                      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