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. Row associated with the currency manager's position cannot be made invisible

Row associated with the currency manager's position cannot be made invisible

Scheduled Pinned Locked Moved C#
databasehelp
4 Posts 4 Posters 2 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.
  • H Offline
    H Offline
    hdv212
    wrote on last edited by
    #1

    hi i add an Unbound DataGridViewCheckBoxColumn to my datagridView for user to select each record that he wants to print (print with DataGridViewPrinter Class), I want to invisible other records that checkbox is False or null, but at RunTime when i set a checkbox to true and uncheck it again (set to false) when i want to invisible that record .. the following error shown me : Row associated with the currency manager's position cannot be made invisible my code is : foreach (DataGridViewRow _gridViewRow in dataGridView1.Rows) { if (_gridViewRow.Cells[0].Value != null) { if (_gridViewRow.Cells[0].Value.ToString() == "True") { _gridViewRow.Visible = true; } else if (_gridViewRow.Cells[0].Value.ToString() == "False") { _gridViewRow.Cells[0].Value = null; ds_zamin1.Khaneh_1.Rows.RemoveAt(_gridViewRow.Index); } } else { _gridViewRow.DataGridView.EndEdit(); _gridViewRow.Visible = false; //Error Occured In this Line } }

    R R 2 Replies Last reply
    0
    • H hdv212

      hi i add an Unbound DataGridViewCheckBoxColumn to my datagridView for user to select each record that he wants to print (print with DataGridViewPrinter Class), I want to invisible other records that checkbox is False or null, but at RunTime when i set a checkbox to true and uncheck it again (set to false) when i want to invisible that record .. the following error shown me : Row associated with the currency manager's position cannot be made invisible my code is : foreach (DataGridViewRow _gridViewRow in dataGridView1.Rows) { if (_gridViewRow.Cells[0].Value != null) { if (_gridViewRow.Cells[0].Value.ToString() == "True") { _gridViewRow.Visible = true; } else if (_gridViewRow.Cells[0].Value.ToString() == "False") { _gridViewRow.Cells[0].Value = null; ds_zamin1.Khaneh_1.Rows.RemoveAt(_gridViewRow.Index); } } else { _gridViewRow.DataGridView.EndEdit(); _gridViewRow.Visible = false; //Error Occured In this Line } }

      R Offline
      R Offline
      redivider
      wrote on last edited by
      #2

      You cannot make selected row/cell inviible. Use...

      dataGridView1.CurrentCell = null;

      1 Reply Last reply
      0
      • H hdv212

        hi i add an Unbound DataGridViewCheckBoxColumn to my datagridView for user to select each record that he wants to print (print with DataGridViewPrinter Class), I want to invisible other records that checkbox is False or null, but at RunTime when i set a checkbox to true and uncheck it again (set to false) when i want to invisible that record .. the following error shown me : Row associated with the currency manager's position cannot be made invisible my code is : foreach (DataGridViewRow _gridViewRow in dataGridView1.Rows) { if (_gridViewRow.Cells[0].Value != null) { if (_gridViewRow.Cells[0].Value.ToString() == "True") { _gridViewRow.Visible = true; } else if (_gridViewRow.Cells[0].Value.ToString() == "False") { _gridViewRow.Cells[0].Value = null; ds_zamin1.Khaneh_1.Rows.RemoveAt(_gridViewRow.Index); } } else { _gridViewRow.DataGridView.EndEdit(); _gridViewRow.Visible = false; //Error Occured In this Line } }

        R Offline
        R Offline
        Rupesh Tarwade
        wrote on last edited by
        #3

        Try this. CurrencyManager cm = CurrencyManager)BindingContext[this.DataGridView1.DataSource]; cm.SuspendBinding(); this.DataGridView1.Rows[index].Visible = false; cm.ResumeBinding();

        L 1 Reply Last reply
        0
        • R Rupesh Tarwade

          Try this. CurrencyManager cm = CurrencyManager)BindingContext[this.DataGridView1.DataSource]; cm.SuspendBinding(); this.DataGridView1.Rows[index].Visible = false; cm.ResumeBinding();

          L Offline
          L Offline
          lildare
          wrote on last edited by
          #4

          thx :)

          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