Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8745065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:56:43+00:00 2026-06-13T11:56:43+00:00

This is my constructor, new VisConfig( string.Empty, string.Empty, new List<SensorConfig>() { new SensorConfig( string.Empty,

  • 0

This is my constructor,

new VisConfig(
string.Empty,
string.Empty,
new List<SensorConfig>()
    {

        new SensorConfig(
        string.Empty, //DGV COl0
        string.Empty, //DGV COl1
        new List<CoveredTrafficLane>()
            {
                new CoveredLane(string.Empty) //DGV COl 2,3,4,5
            },
                new RseDevicePosition(
                new ValueWithUnit<int>(0, "mm"), //DGV COl6
                new ValueWithUnit<int>(0, "mm"), //DGV COl7
                new ValueWithUnit<int>(0, "mm"), //DGV COl8
                new ValueWithUnit<int>(0, "tenthOfDegree"), //DGV COl9
                new ValueWithUnit<int>(0, "tenthOfDegree"), //DGV COl10
                new ValueWithUnit<int>(0, "tenthOfDegree")), //DGV COl11
                0, //DGV COl12
                0) //DGV COl13
    },

I’m trying to get the data from the DGV(winform) to this constructor.

Plase help me, how can i get the datagridvalue and fill it to the constructor.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T11:56:44+00:00Added an answer on June 13, 2026 at 11:56 am

    If I understand right your question -> your constructor of DtuSensorConfig take data from one row of DataGridView.
    So create List outside of VisConfig constructor and then pass this list there.

    List<DtuSensorConfig> dSensorConf = new List<DtuSensorConfig>()
    foreach (DataGridViewRow dr in dataGridView3.Rows)
    {
        //Create a CoveredTrafficLane list 
        List<CoveredTrafficLane> covTrafLane = new List<CoveredTrafficLane>();
        //DGV COl 2,3,4,5
        covTrafLane.Add(New CoveredTrafficLane(dr.Cells["DGVCOL2"].Value.ToString()));
        covTrafLane.Add(New CoveredTrafficLane(dr.Cells["DGVCOL3"].Value.ToString()));
        covTrafLane.Add(New CoveredTrafficLane(dr.Cells["DGVCOL4"].Value.ToString()));
        covTrafLane.Add(New CoveredTrafficLane(dr.Cells["DGVCOL5"].Value.ToString()));
    
        //Create RseDevicePosition
        RseDevicePosition devPos;
        int ctx = 0;
        Int32.TryParse(dr.Cells["dtux"].Value.ToString(), out ctx);
        int cty = 0;
        Int32.TryParse(dr.Cells["dtuy"].Value.ToString(), out cty);
        int ctz = 0;
        Int32.TryParse(dr.Cells["dtuz"].Value.ToString(), out ctz);
        int dtuazu = 0;
        Int32.TryParse(dr.Cells["dtuazim"].Value.ToString(), out dtuazu);
        int dtuele = 0;
        Int32.TryParse(dr.Cells["dtuele"].Value.ToString(), out dtuele);
        int dtuti = 0;
        Int32.TryParse(dr.Cells["dtutilt"].Value.ToString(), out dtuti);
    
        devPos = new RseDevicePosition(
        new ValueWithUnit<int>(ctx, "mm"),
        new ValueWithUnit<int>(cty, "mm"),
        new ValueWithUnit<int>(ctz, "mm"),
        new ValueWithUnit<int>(dtuazu, "tenthOfDegree"),
        new ValueWithUnit<int>(dtuele, "tenthOfDegree"),
        new ValueWithUnit<int>(dtuti, "tenthOfDegree"));
    
        //here create a DtuSensorConfig
        dSensorConf.Add(
            new DtuSensorConfig(dr.Cells["DGVCOL0"].Value.Tostring(), //DGV COl0
                                dr.Cells["DGVCOL1"].Value.Tostring(), //DGV COl1       
                                covTrafLane,
                                devPos));
    }
    VisConfig vConf = new VisConfig(string.Empty,
                                    string.Empty,
                                    dSensorConf); // 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In C++ , during a class constructor, I started a new thread with this
I have a varargs constructor like this : public class Sentence { public String[]
Say I have this constructor in C++: A::A( std::string const& name, std::string const& type,
This is a simple question really. I've been using the new type of constructors
when this copy constructor is called in my application, this copy constructor goes into
Why do IDE's complain about leaking this in constructor? I've always assumed that it's
I have the below prog Object.prototype.inherit = function(baseConstructor) { this.prototype = (baseConstructor.prototype); this.prototype.constructor =
I need this because the constructor in the superclass is calling a method which
I have a class constructor like this: public JavoImageCorrectedDataHeader() { ByteBuffer buffer = ByteBuffer.allocate(this.size());
Can I use default arguments in a constructor like this maybe Soldier(int entyID, int

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.