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. CurrentRowIndex

CurrentRowIndex

Scheduled Pinned Locked Moved C#
questioncsharphelp
8 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.
  • R Offline
    R Offline
    Rmokkenstorm
    wrote on last edited by
    #1

    hi there I want to select a row from my datagrid but he returns me the following error. what exactly is this error and how can i solve it? I use visual C# 2005 'System.Windows.Forms.DataGridView' does not contain a definition for 'CurrentRowIndex' int rowIndex = dBANBM_T075_BORGTOCHTDataGridView.CurrentRowIndex; { CustomRow(this, new CustomRowEventArgs(testdb1DataSet, dBANBM_T075_BORGTOCHTDataGridView, rowIndex));

    J M 2 Replies Last reply
    0
    • R Rmokkenstorm

      hi there I want to select a row from my datagrid but he returns me the following error. what exactly is this error and how can i solve it? I use visual C# 2005 'System.Windows.Forms.DataGridView' does not contain a definition for 'CurrentRowIndex' int rowIndex = dBANBM_T075_BORGTOCHTDataGridView.CurrentRowIndex; { CustomRow(this, new CustomRowEventArgs(testdb1DataSet, dBANBM_T075_BORGTOCHTDataGridView, rowIndex));

      J Offline
      J Offline
      jeyapandian
      wrote on last edited by
      #2

      hi, Datagridview dont have a currentRowIndex property it has to be rewritten like this . int rowIndex = dBANBM_T075_BORGTOCHTDataGridView.CurrentCell.RowIndex or you can rewrite CustomRow(this, new CustomRowEventArgs(testdb1DataSet, dBANBM_T075_BORGTOCHTDataGridView, dBANBM_T075_BORGTOCHTDataGridView.CurrentCell.RowIndex)); good luck Where there is a will,there is a way.

      R 1 Reply Last reply
      0
      • J jeyapandian

        hi, Datagridview dont have a currentRowIndex property it has to be rewritten like this . int rowIndex = dBANBM_T075_BORGTOCHTDataGridView.CurrentCell.RowIndex or you can rewrite CustomRow(this, new CustomRowEventArgs(testdb1DataSet, dBANBM_T075_BORGTOCHTDataGridView, dBANBM_T075_BORGTOCHTDataGridView.CurrentCell.RowIndex)); good luck Where there is a will,there is a way.

        R Offline
        R Offline
        Rmokkenstorm
        wrote on last edited by
        #3

        i thought i doen's excist.. but it's so strange.. 'cause a normal datagird had the currentrowindex. what is so different to a datagrid or datagrid view. i put your code in my project.. int rowIndex = dBANBM_T075_BORGTOCHTDataGridView.CurrentCell.RowIndex and he give's me the following error: (There is no row at position 3.) my code to read the row into a textbox = testdb1DataSet DSet = e.DSet; DataGridView grid = e.Grid; int row = e.Row; textBox1.Text = e.DSet.Tables[0].Rows[e.Row]["T075_BORGTOCHTNUMMER_1"].ToString();

        J 1 Reply Last reply
        0
        • R Rmokkenstorm

          i thought i doen's excist.. but it's so strange.. 'cause a normal datagird had the currentrowindex. what is so different to a datagrid or datagrid view. i put your code in my project.. int rowIndex = dBANBM_T075_BORGTOCHTDataGridView.CurrentCell.RowIndex and he give's me the following error: (There is no row at position 3.) my code to read the row into a textbox = testdb1DataSet DSet = e.DSet; DataGridView grid = e.Grid; int row = e.Row; textBox1.Text = e.DSet.Tables[0].Rows[e.Row]["T075_BORGTOCHTNUMMER_1"].ToString();

          J Offline
          J Offline
          jeyapandian
          wrote on last edited by
          #4

          hi, my previous reply for that particular error message. if you want to get a value from gridview you could use something like this textbox1.Text = myGridView[RowIndex]["T075_BORGTOCHTNUMMER_1"].Value.ToString(); the error mentioned in your last mail related to your dataset not with datagridview... good luck. Where there is a will,there is a way.

          R 1 Reply Last reply
          0
          • J jeyapandian

            hi, my previous reply for that particular error message. if you want to get a value from gridview you could use something like this textbox1.Text = myGridView[RowIndex]["T075_BORGTOCHTNUMMER_1"].Value.ToString(); the error mentioned in your last mail related to your dataset not with datagridview... good luck. Where there is a will,there is a way.

            R Offline
            R Offline
            Rmokkenstorm
            wrote on last edited by
            #5

            i really feeling noob right now .. but.. The name 'RowIndex' does not exist in the current context code = testdb1DataSet DSet = e.DSet; DataGridView grid = e.Grid; int row = e.Row; textBox1.Text = grid[RowIndex]["T075_BORGTOCHTNUMMER_1"].Value.ToString(); think i should use something like int RowIndex = CustomRow; but then i get the error: No overload for method 'this' takes '1' arguments

            J 1 Reply Last reply
            0
            • R Rmokkenstorm

              i really feeling noob right now .. but.. The name 'RowIndex' does not exist in the current context code = testdb1DataSet DSet = e.DSet; DataGridView grid = e.Grid; int row = e.Row; textBox1.Text = grid[RowIndex]["T075_BORGTOCHTNUMMER_1"].Value.ToString(); think i should use something like int RowIndex = CustomRow; but then i get the error: No overload for method 'this' takes '1' arguments

              J Offline
              J Offline
              jeyapandian
              wrote on last edited by
              #6

              hi , textBox1.Text = grid["T075_BORGTOCHTNUMMER_1",row].Value.ToString(); sorry man, i wrote just on the fly..didnt check the syntax. good luck. Where there is a will,there is a way.

              R 1 Reply Last reply
              0
              • J jeyapandian

                hi , textBox1.Text = grid["T075_BORGTOCHTNUMMER_1",row].Value.ToString(); sorry man, i wrote just on the fly..didnt check the syntax. good luck. Where there is a will,there is a way.

                R Offline
                R Offline
                Rmokkenstorm
                wrote on last edited by
                #7

                eh it works great.. textBox1.Text = grid["dataGridViewTextBoxColumn1", row].Value.ToString(); i used this and it works! only one question left.. what is the big difference between a datagrid or datagridview.. cause in some other project (made with visual studio 2003) i use a datagrid and the currentrowindex does work.. many thanks

                1 Reply Last reply
                0
                • R Rmokkenstorm

                  hi there I want to select a row from my datagrid but he returns me the following error. what exactly is this error and how can i solve it? I use visual C# 2005 'System.Windows.Forms.DataGridView' does not contain a definition for 'CurrentRowIndex' int rowIndex = dBANBM_T075_BORGTOCHTDataGridView.CurrentRowIndex; { CustomRow(this, new CustomRowEventArgs(testdb1DataSet, dBANBM_T075_BORGTOCHTDataGridView, rowIndex));

                  M Offline
                  M Offline
                  m rastgar
                  wrote on last edited by
                  #8

                  change the code to this: int rowIndex = dBANBM_T075_BORGTOCHTDataGridView.CurrentRow.Index Thanks Rastgar

                  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