如何取得DATAGIRD里CHECK
Box和TEXT
Box的值? 我想把DATAGRID的里的值取出来,放在一个DATATBALE里,
代码如下: Public Function dt() As DataTable Dim i As Integer Dim j As Integer Dim dt1 As DataTable = New DataTable dt1.Columns.Add(New DataColumn( delflg,Type.GetType( System.Boolean ))) dt1.Columns.Add(New DataColumn( txtMtype,Type.GetType( System.String ))) dt1.Columns.Add(New DataColumn( txtBikou,Type.GetType( System.String ))) Dim delflg As Boolean Dim txtMtype As Text
Box Dim txtBikou As Text
Box Dim listitem As DataGridItem max_row = Me.dgMeetingtype.Items.Count For i = 0 To max_row - 1 listitem = Me.dgMeetingtype.Items(i) If i < max_row - 1 Then delflg = CType(listitem.FindControl( chkDel ),Check
Box).Checked End If txtMtype = CType(listitem.FindControl( txtMtype ),Text
Box) txtBikou = CType(listitem.FindControl( txtBiko ),Text
Box) Dim myRow As DataRow = dt1.NewRow() myRow(0) = delflg myRow(1) = txtMtype.Text myRow(2) = txtBikou.Text dt1.Rows.Add(myRow) Next i Return dt1 End Function 这样有什么不对吗?好像是CHECK
Box和TEXT
Box的值改了,我却
获取不到,得到的还是绑定DATAGRID时候的值。高手帮帮忙啊~! __________________________________________________________________________ 自己顶一下,希望有高手来
解决!谢谢了 __________________________________________________________________________ Text
Box tb=(Text
Box)datagrid1.findControl( your Text
Boxid ); __________________________________________________________________________ 嗯,问题已
解决。 我的问题出在PAGE_LOAD里 加一个ISPOSTBACK
方法就好了。 谢谢! __________________________________________________________________________