在VS.NET中创建了一个Windows应用程序,在其中添加了一个DataGrid控件、一个Retrieve按钮,通过单击此按钮,如何在DataGrid控件中显示某个数组中的元素?
我已经为数组建立了一个包装类,代码如下:
protected class Item
{
private string m_text;
public Item(string text)
{
m_text=text;
}
public string Text
{
get {return m_text;}
}
}
如何建立一个此类的数组,然后在Retrieve按钮的Click事件处理程序中编写代码在DataGrid中显示数组中的元素??
我已经为数组建立了一个包装类,代码如下:
protected class Item
{
private string m_text;
public Item(string text)
{
m_text=text;
}
public string Text
{
get {return m_text;}
}
}
如何建立一个此类的数组,然后在Retrieve按钮的Click事件处理程序中编写代码在DataGrid中显示数组中的元素??
解决方案 »
- SQL取最大值
- 关于数据表的逻辑处理的问题,给个思路~~~~~
- 无法将类型“System.Windows.Forms.Control”转换为“System.Windows.Forms.Timer”
- c#问题
- 就这一个错误,怎么都找不到!请师傅们帮帮我!
- 请教有关事件使用的问题
- 怎样在C#中得到Excel的所有有效列名
- 用WebClient 类获得XML数据出了问题
- WebBrowser 怎么响应网页中 Flash 元素的事件?
- C# 结合openfileDialog和saveFileDialog如何实现SQL数据库备份和恢复
- 序列化的问题.
- 调用WebService时,出现:未将对象引用设置到对象的实例
for(int i=0;i<items.length;i++)
items[i] = new Item("xxx");
class strIndex
{
public string[] stringList=new string[10];
public int this[int index]
{
get
{
return studentList[index];
}
set
{
studentList[index]=value.ToString();
}
}
}
class Test
{
static void Main()
{
StrIndex objIndex = new StrIndex();
//for
objIndex[1] = "Tom";
System.Console.WriteLine(objIndex[1]);
}}