LacOniC wrote:
Array is like that: (2 dimension, i said 3 in first message sorry)
string[,] TestType = { {"SAT1", "1", "1000"},
{"ACT", "2", "21"},
{"GCE 2 Certificates", "3", "2 Course"},
{"IB International Baccalaureate", "4", ""},
{"French Baccalaureate", "5", ""},
Actually, what you need is a 1-dimension array of objects:
class TestType
{
public string TypeOfTest;
public string MinPoint;
public string Value;
public TestType (string tt, string mp, string v)
{
TypeOfTest = tt;
MinPoint = mp;
Value = v;
}
public override string ToString()
{
return String.Format("{0} | {1} | {2}", TypeOfTest,
MinPoint, Value);
}
}
TestType [] TestTypes = new TestType[] {
new TestType("SAT1", "1", "1000"),
new TestType("ACT", "2", "21"),
new TestType("GCE 2 Certificates", "3", "2 Course"),
new TestType("IB International Baccalaureate", "4",
""),
new TestType("French Baccalaureate", "5", "")
}
foreach (TestType tt in TestTypes)
ddlTypeOfTest.Items.Add(tt);
ddlTypeOfTest.DataBind();
private void ddlTypeOfTest_SelectedIndexChanged(object sender,
System.EventArgs e)
{
TestType tt = ddlTypeOfTest.SelectedItem as TestType;
txtMinimumScore.Text = tt.Value;
}