templateFieldsグリッドビューの'値をに追加しようとしていList(Of String)ます。それらtemplateFieldsは2で構成されますLabels。私が達成しようとしているのは
のすべての行をループできるようにするには
GridView、繰り返しのtemplateField値を取得します。行の
TemplateFields1値を文字列に格納します。その文字列を文字列のリストに追加します。
これが私のコードです:
For Each row As GridViewRow In GridView1.Rows`
Dim stri As String
Dim ttt As Label = DirectCast(row.FindControl("Title"), Label)
Dim desc As Label = DirectCast(row.FindControl("lblDescription"), Label)
stri = ttt.Text.ToString & desc.Text.ToString
Dim list As New List(Of String)
While (stri <> Nothing)
list.Add(stri) ' Add every new string in a new index of the list
End While
Next
したがって、whileループでは、striそれを格納してlist(0)から続行しfor loop、次を取得して、すべてが完了するまで保持しながらstriの新しいインデックスに格納します。list(1)list(0)templateField stri
何か考えや提案はありますか?