简体   繁体   中英

C# ASP.NET how to specify second value in three dimensional list

could someone help me witht his problem in which i would like to apply two changes,

I try to create a three dimensional list as shown below:

_Default.parallellist2.Add(new List<List<string>>() { (new List<string>() { TextBox9.Text, TextBox10.Text, 
TextBox11.Text, TextBox12.Text, TextBox13.Text, TextBox14.Text, TextBox15.Text, TextBox16.Text }) });

in here i would like to manipulate the second value, in which dependant on another signal would reset the counting for the second dimension and add to the first dimension, but i don't know how to reset it without interfering with the source value because of the eference type,and adding values doesn't seem to change the second value but the frist value eg:

parallellist2[0][0][all the textbox values]
parallellist2[0][1][all the textbox values]

after signal

parallellist2[1][0][all the textbox values]
parallellist2[1][1][all the textbox values]

but the problem is that i don't know how to change and store values in the second dimension, and on top of that also reset the indexer, what i now get is the following:

parallellist2[0][0][all the textbox values]
parallellist2[1][0][all the textbox values]

can someone help me with this problem

i found out how to tackle this problem, instead of using

_Default.parallellist2.Add(new List<List<string>>() { (new List<string>() { TextBox9.Text, TextBox10.Text, 
TextBox11.Text, TextBox12.Text, TextBox13.Text, TextBox14.Text, TextBox15.Text, TextBox16.Text }) });

i used

_Default.parallellist2.insert(i,new List<List<string>>() { (new List<string>() { TextBox9.Text, TextBox10.Text, 
TextBox11.Text, TextBox12.Text, TextBox13.Text, TextBox14.Text, TextBox15.Text, TextBox16.Text }) });

where i is the number which should have changed after the impulse has been activated

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM