Hi,
I'm having problems returning the text value of a label that is databound in a parent <code>gridview. I need to use the text value to assign it to a select parameter in a child <code>gridview but it keeps throwing a null reference. Can anyone see a problem with the following code?
<code>gridview
I have a parent gridview called browsetopicsview, a child gridview called NestedPostCount a databoud label called CreatedBy which is what i want in the where clause of the child select statment.
NestedPostCount
Protected Sub BrowseTopicsView_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles BrowseTopicsView.RowDataBound Dim s As SqlDataSource = CType(e.Row.FindControl("NestedPostCount"), SqlDataSource) Dim g As New Label g = CType(FindControl("CreadtedBy"), Label) Try s.SelectParameters(0).DefaultValue = g.Text Catch MsgBox("An error has occured in the database, please try again later") End Try End Sub
Thanks,
Chris
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)