用数组把,datagrid的数据源支持数组的!
解决方案 »
- 两个线程,以写一个TXT,另一个读出该TXT的数据,总是冲突,求救啊。
- 求救 SQL server 安全性
- c# 如何探测局域网内的活动主机
- C# windowns程序如何打包成一个exe文件
- 对继承的理解?
- 怎么把textbox搜索到的内容赋給datagrid控件!
- c#中相当于c++中“&”的符号是哪个? 怎样表示参数是 引用传递?
- vs.net windows应用程序项目,生成的可执行程序在别人的机器上执行不了,要命!
- 如何调用winapi?并初始化某一个结构体的大小
- C#里有没有Chr()?
- @@@@@@@listView显示图片的问题@@@@@@@@
- ★★★求助如何用C#实现在jpeg,jif等图片加入水印,也就是在图片中嵌入文字或者图片★★★
arr(0)="first"
datagrid1.setdatabinding(arr,nothing)
就行了
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim arr(0) As item
arr(0) = New item
arr(0).text = "first"
DataGrid1.SetDataBinding(arr, Nothing)
End Sub
End Class
Public Class item
Private m_text As String
Public Property text() As String
Get
Return m_text
End Get
Set(ByVal Value As String)
m_text = Value
End Set
End Property
Then set the DataSource Property of the DataGrid as your DataTable.
if(e.Item.ItemIndex==1)
{
e.Item.Cell[1].Text = "first";
}