List A = new List();
A.Add("Apple"); A.Add("Banana"); A.Add("Pineapple");dataGridView.DataSource = a;
Result: is the length of each item in the list rather than Item itself.
5 6 9 How can I make datagri开发者_JAVA技巧dView to display string instead of length.Try using a List to actually take the string values rather than representing them by the char[].Count();
For example:
List<string> A = new List<string>();
A.Add("Apple");
A.Add("Banana");
A.Add("Pineapple");
dataGridView.ItemSource = A;
精彩评论