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. Strange reaction from a DataGridView

Strange reaction from a DataGridView

Scheduled Pinned Locked Moved C#
help
1 Posts 1 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.
  • J Offline
    J Offline
    Johnny 0
    wrote on last edited by
    #1

    I am having a problem I am not sure why is hapening. In the following code, if I put the line with the Clone() method before the this.datagridSplit.Panel2.Controls.Add(dataGrid); it works well but I get the error No parameterless constructor defined for this object in a MissingMethodException. My guess is that is because the object is occupied on another thread but I am not sure. Note that when the dataGrid is added to a control I fire another event that modifies the bound table of the datagrid.:( What a day! public void SetFinder(ref ComplexObject finderObject) //Type ComplexObject is a typed dataset { finderObject.Read(); complexObject = finderObject; dataGrid = finderObject.FinderDatagrid; dataGrid.ColumnHeadersVisible = false; this.datagridSplit.Panel2.Controls.Add(dataGrid); emptyDataSet = finderObject.Clone(); emptyDataSet.EnforceConstraints = false; emptyDataSet.Tables[0].Rows.Add(null, null); emptyDataSet.AcceptChanges(); emptyDataGrid.DataSource = emptyDataSet.Tables[0]; emptyDataGrid.AllowUserToAddRows = false; emptyDataGrid.Dock = DockStyle.Fill; emptyDataGrid.RowHeadersVisible = false; this.datagridSplit.Panel1.Controls.Add(emptyDataGrid); this.emptyDataGrid.CellValueChanged += new DataGridViewCellEventHandler(emptyDataGrid_CellValueChanged); this.emptyDataGrid.CellLeave += new DataGridViewCellEventHandler(emptyDataGrid_CellLeave); }

    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