Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Protected Sub GridView1_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound
- If e.Row.RowType = DataControlRowType.DataRow Then
- Dim lb As Label = CType(e.Row.FindControl("Label1"), Label)
- lb.Text = "test"
- End If
- End Sub
- Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
- Dim dtTest As DataTable = New DataTable("Test")
- dtTest.Columns.Add(New DataColumn("col1"))
- dtTest.Columns.Add(New DataColumn("col2"))
- Dim dwrTest As DataRow = dtTest.NewRow
- dwrTest("col1") = "123"
- dwrTest("col2") = "456"
- dtTest.Rows.Add(dwrTest)
- GridView1.DataSource = dtTest
- GridView1.DataBind()
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement