button inside a gridview to display more detailed grid view
-
This is the code for the first gridview,when the page open it should display the names of all the project members, Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Page.IsPostBack = False Then 'txtProjectManager.Text = Session("ProjectManager") Dim obj As Businesslayer.TimeSheet = New Businesslayer.TimeSheet Dim ds As New Data.DataSet ds = obj.GetProjectMembers1 GridView2.DataSource = ds GridView2.DataBind() End If End Sub This is the code foe the btn when I click the button inside the gridview it must show,the second gridview for each row Private Sub Button1_Click(ByVal o As Object, ByVal e As EventArgs) Dim Button1 As Button = DirectCast(o, Button) Dim grdRow As GridViewRow = DirectCast(Button1.Parent.Parent, GridViewRow) Dim strField1 As String = grdRow.Cells(0).Text Dim strField2 As String = grdRow.Cells(0).Text End Sub This is the code for the second grid view Protected Sub GridView2_SelectedIndexChanging(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridView2.SelectedIndexChanged Dim gv As GridView = CType(sender, GridView) Dim ds As New Data.DataSet Dim obj As Businesslayer.TimeSheet = New Businesslayer.TimeSheet ds = obj.GetTimeSheet(gv.SelectedValue.ToString()) obj = Nothing GridView1.DataSource = ds GridView1.DataBind() End Sub When I click the btn,it only postback,doesn’t display the second gridview,what might be the problem?