How to convert string to List in windowsforms?

Kanaparthi Sureshma Reddy

Kanaparthi Sureshma Reddy

Aug 7 2015 6:09 AM
I want to convert string value to List.How to Convert this.
Here is My Code.
private void TestGridData_CellContentClick(object sender, DataGridViewCellEventArgs e)
DataGridViewRow row = new DataGridViewRow();
List<string> TestName = new List<string>();
int I = TestGridData.CurrentCell.ColumnIndex;
string Head = TestGridData.Columns[I].Name;
if (Head == "check")
row = TestGridData.CurrentRow;
int row2 = row.Index;
TestCost = Convert.ToInt32(TestGridData[2, row2].Value);
string Name = TestGridData[1, row2].Value.ToString();

// TestName=Name as List<string>;

sum = sum + TestCost;
txtcost.Text = sum.ToString();

And the string value stored in Name and list stored in TestName.How to convert this Name to List.In this the commented line i tried but i didn't get correct output.

Please help me to get correct output

Answers (2)