I'm trying to embed a datagrid into another datagrid. I believe I need to use the OnItemDataBound to do the embedding but I cannot get it to even call or I don't think its being called since mytest line isn't writing. It fills the first two columns of the datagrid with the appropriate data.
Here is the code where the binding takes place and the OnItemDataBound method:
Private Sub get_outerData()
db_connection.Open()
sqlStr = "SELECT userName, password FROM users"
Dim dAdapter = New OleDbDataAdapter(sqlStr, db_connection)
dAdapter.fill(outer_results, "outer")
dg_outer.DataSource = outer_results
dg_outer.DataBind()
db_connection.Close()
End Sub
Protected Sub dg_outer_OnItemDataBound(ByVal sender As Object, ByVal e As DataGridItemEventArgs)
lbl_output.Text = "In data bound"
If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then
lbl_output.Text = "In databound if statement"
End If
End Sub
Here is the code where the binding takes place and the OnItemDataBound method:
Private Sub get_outerData()
db_connection.Open()
sqlStr = "SELECT userName, password FROM users"
Dim dAdapter = New OleDbDataAdapter(sqlStr, db_connection)
dAdapter.fill(outer_results, "outer")
dg_outer.DataSource = outer_results
dg_outer.DataBind()
db_connection.Close()
End Sub
Protected Sub dg_outer_OnItemDataBound(ByVal sender As Object, ByVal e As DataGridItemEventArgs)
lbl_output.Text = "In data bound"
If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then
lbl_output.Text = "In databound if statement"
End If
End Sub