got that 2 seconds after post the message, but still wont work, then I tried
again (for the 100th time) search the internet finding a solution and here
it is:
Dim gv As GridViewRow
Dim str As String = ""
For Each gv In gvItems.Rows
If gv.RowType = DataControlRowType.DataRow Then
Dim dropDownListText As String = CType(gv.FindControl("qty"),
DropDownList).SelectedItem.Value
Dim CheckBoxChecked As Boolean = CType(gv.FindControl("rem"),
CheckBox).Checked
If CheckBoxChecked Then
str &= dropDownListText & "<br/>"
End If
End If
Next
I dont know why, but I need to change the names :-(
But now it works perfectly :-) ... I'm so happy!!! it took me 2 days to get
an answer :-/
but know I can help other with the same question ;-)
--
Bruno Alexandre
(a Portuguese in Københanv, Danmark)
"clickon" <cl*****@discussions.microsoft.com> escreveu na mensagem
news:D9**********************************@microsof t.com...
surely this line:
dd = CType(gvItems.FindControl("dd1"), DropDownList)
should read
dd = CType(gv.FindControl("dd1"), DropDownList)
If you want it to look for the control dd1 on each row in the loop.
"Bruno Alexandre" wrote:
Hi guys,
I have this code:
Dim gv As GridViewRow
Dim str As String = ""
Dim dd As DropDownList
For Each gv In gvItems.Rows
If gv.RowType = DataControlRowType.DataRow Then
str &= gv.RowType.ToString & "<br/>"
dd = CType(gvItems.FindControl("dd1"), DropDownList)
If dd IsNot Nothing Then
str &= "found"
End If
End If
Next
and I can't get into str &= "found"
it doesn't find the control... What I'm doing wrong? the control is
showed
in the page! and has the id = "dd1"
Any help?... please.
--
Bruno Alexandre
(a Portuguese in Københanv, Danmark)