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 8827291
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:20:18+00:00 2026-06-14T07:20:18+00:00

This way I’m accessing as a list from my datagridview. The problem I’m facing

  • 0

This way I’m accessing as a list from my datagridview. The problem I’m facing here..Lets say if i have 6 rows in the DGV, when it updates to the list it shows 36rows.
How can i fix this problem??

for (int i = 0; i < testDsrcConfigs .Count; i++ )
            {
                Console.WriteLine(testDsrcConfigs [i]);
            }

From the for loop, i can see 6 rows.
Is it possible to use for loop?? How can i adapt fro loop to access the members??Please help me..!

List<SdrcConfig> testDsrcConfigs = new List<SdrcConfig>();


foreach (GridViewRowInfo dr in RadGridView.Rows)
    {
        //Create a TrafficLane list 
        List<TrafficLane> covTrafLane = new List<TrafficLane>();

        if (dr.Cells["bct0"].Value != "XXXX")
            {
                covTrafLane.Add(new TrafficLane(dr.Cells["bct0"].Value.ToString()));
            }
        if (dr.Cells["bct1"].Value != "XXXX")
            {
                covTrafLane.Add(new TrafficLane(dr.Cells["bct1"].Value.ToString()));
            }
        if (dr.Cells["bct2"].Value != "XXXX")
            {
                covTrafLane.Add(new TrafficLane(dr.Cells["bct2"].Value.ToString()));
            }
        if (dr.Cells["bct3"].Value != "XXXX")
            {
                covTrafLane.Add(new TrafficLane(dr.Cells["bct3"].Value.ToString()));
            }

            //Create RseDevicePosition
            DevicePosition devPos;
            int ctx;
            Int32.TryParse(dr.Cells["bx"].Value.ToString(), out ctx);
            int cty;
            Int32.TryParse(dr.Cells["by"].Value.ToString(), out cty);
            int ctz;
            Int32.TryParse(dr.Cells["bz"].Value.ToString(), out ctz);
            int bazu;
            Int32.TryParse(dr.Cells["bazim"].Value.ToString(), out bazu);
            int bele;
            Int32.TryParse(dr.Cells["belev"].Value.ToString(), out bele);
            int bti;
            Int32.TryParse(dr.Cells["btilt"].Value.ToString(), out bti);


            ushort devnum = UInt16.Parse(dr.Cells["bdevnum"].Value.ToString());

            devPos = new DevicePosition(
                new ValueWithUnit<int>(ctx, "mm"),
                new ValueWithUnit<int>(cty, "mm"),
                new ValueWithUnit<int>(ctz, "mm"),
                new ValueWithUnit<int>(bazu, "tenthOfDegree"),
                new ValueWithUnit<int>(bele, "tenthOfDegree"),
                new ValueWithUnit<int>(bti, "tenthOfDegree"));


            ((MyConfig.
            .ObuTransactionSystemConfig as DsrcTransactionSystemConfig).
                 DsrcSystemConfig as MultiLaneDsrcSystemConfig).DsrcConfigs.ForEach(
                     dsrcBeacon => testDsrcConfigs.Add(
                         new SdrcConfig(
                             dr.Cells["bid"].Value.ToString(), 
                             dr.Cells["bdesc"].Value.ToString(),        
                             covTrafLane,
                             devPos, devnum,
                             dsrcBeacon.Settings)));
    }
  • 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-14T07:20:19+00:00Added an answer on June 14, 2026 at 7:20 am

    Make the following change:

    ((MyConfig.
            .ObuTransactionSystemConfig as DsrcTransactionSystemConfig).
                 DsrcSystemConfig as MultiLaneDsrcSystemConfig).DsrcConfigs.ForEach(
                     dsrcBeacon => testDsrcConfigs.Add(
                         new SdrcConfig(
                             dr.Cells["bid"].Value.ToString(), 
                             dr.Cells["bdesc"].Value.ToString(),        
                             covTrafLane,
                             devPos, devnum,
                             dsrcBeacon.Settings)));
    

    to

    testDsrcConfigs.Add(
                         new SdrcConfig(
                             dr.Cells["bid"].Value.ToString(), 
                             dr.Cells["bdesc"].Value.ToString(),        
                             covTrafLane,
                             devPos, devnum,
                             ((MyConfig.
        .ObuTransactionSystemConfig as DsrcTransactionSystemConfig).
             DsrcSystemConfig as MultiLaneDsrcSystemConfig).DsrcConfigs[0].Settings);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This way I can delete empty rows from one datagridview. bool Empty = true;
Let me frame it this way.. Say I have an application server running on
Consider this way of solving the Subset sum problem: def subset_summing_to_zero (activities): subsets =
I send data in this way: <form method=post enctype=text/plain action=Func> And I have a
This is the first time I have manipulated hashes and arrays in this way
I have a menu set up this way: <div id='top-navigation'> <ul> <li><a class='top-nav-button-unclicked' href='#'>SUBJECT</a></li>
I save picture from UIImagePicker this way: Save picture in file and then I
I save picture from UIImagePicker this way: Save picture in file and then I
I call my site this way locally: http://localhost:80/mysite/de/layer1/layer2/module In .htaccess I have: RewriteEngine on
I have customized the button in this way: <Button BorderBrush=Transparent Name=DialButton Click=DialButton_Click > <StackPanel

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.