我用数组作为DataGridView数据源的时候,它只显示数组里每项的长度...怎么不能样才能显示实际的字符串...
...这是代码...
string[] para = new string[] { "one", "two", "three" };
this.dataGridView1.DataSource = para;...显示结果...
.Length
3
3
5要怎样才能显示出
one
two
three
...这是代码...
string[] para = new string[] { "one", "two", "three" };
this.dataGridView1.DataSource = para;...显示结果...
.Length
3
3
5要怎样才能显示出
one
two
three
解决方案 »
- c# comboBox动态填充,能添加两个值吗
- 在 C#代码中经常看到 "e".什么意思
- rdlc报表打不出来,不知道是什么原因,大家看一下吧
- 不明白,xml 配置、webservice 都是咋回事。C/S的也用webservice? 局域网中的? xml配置文件为什么必须有它?
- Windows服务程序调用axWebBrowser控件出错:
- C#求解
- 提取子字符串的问题
- .net使用存贮过程的问题
- 控件的HelpKeyword属性如果设为中文,当调出CHM文件时显示为乱码?
- 简单变量问题!
- 请问 如何 以一个点 为中心 等比例 缩放 图片?
- WinForm dataGridView如何设置高度变化?
public class TestView
{
private String m_Test;
public String Test
{
get { return m_Test; }
set { m_Test = value; }
}
}
this.GridView1.DataSource = test;
this.GridView1.DataBind();没有问题啊。显示的就是one,tow,three
我换成datatable,不知道你能不能接受
string[] test = new string[] { "one", "tow", "three" };
DataTable dt = new DataTable();
DataColumn col = new DataColumn("test");
dt.Columns.Add(col);
foreach (string tt in test)
{
dt.Rows.Add(tt);
}
this.dataGridView1.DataSource = dt;