Grasshopper

algorithmic modeling for Rhino

Something weird!Using Datagridview control in custom component problem

Hello  everyone,when i use Datagridview control in my custom component ,the picture shown below,

some weird things happened. i want to use Datagridview to input some data,and the DatagridviewRow matches the input parameters count...everything look like ok util i copy my component and create another instance,when i change one of the Datagridview the other one will be changed too...i guess i perhaps make a stupid mistake about by reference and by value,i wrote the component like this:

public class MyComponent : GH_Component {
private readonly List<DataGridViewRow> m_ic_rows;

......
}
————————————————————————————————————————————
And use AssignValues() & RetrieveValues() to pass DatagridviewRow between Form and GH component. Also when i click the "Draw full name" command ,the entire Datagridview will lost,like this:
then i change the List<DataGridViewRow> to List<List<string>>,but the result is the same.i dont know what happened when copy GH component to another instance,is there some deep copy will take place? or something else......
there is anyone can help me?

Views: 318

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service