I've been looking at many posts in the forum and feel like I've followed the suggestions properly, but I can't get it working.
I've setup a linkbutton in my grid. When the user clicks the linkbutton, I would like the value in column 2 to be picked up and used as a parameter for another grid. This other grid will reside an a new page, so once the parameter value is set, the new page should load. Here is my code:
I'm not sure why my ItemCommand code won't fire. Is the Page_Load datagrid bind code causing my problems?
I've setup a linkbutton in my grid. When the user clicks the linkbutton, I would like the value in column 2 to be picked up and used as a parameter for another grid. This other grid will reside an a new page, so once the parameter value is set, the new page should load. Here is my code:
Code:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Panel1.Controls.Add(Me.LoadControl("Banner.ascx"))
Panel2.Controls.Add(Me.LoadControl("Left.ascx"))
Dim cf As New MandT.CLD.Inquiry.BusinessTier.BLL
CustomerSearchDataSet = cf.GetCustomerFilterDataSet(Session("search1"), Session("search2"), Session("search3"), Session("search4"), Session("search5"))
ResultGrid.DataSource = CustomerSearchDataSet
ResultGrid.DataBind()
End Sub
Private Sub ResultGrid_PageIndexChanged(ByVal source As System.Object, ByVal e As System.Web.UI.WebControls.DataGridPageChangedEventArgs)
ResultGrid.CurrentPageIndex = e.NewPageIndex
' If the grid is sorted, reapply the sort expression here.
ResultGrid.DataBind()
End Sub
Private Sub ResultGrid_ItemCommand(ByVal source As System.Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs)
If e.CommandName = "GetObligor" Then
Session("Obligor") = e.Item.Cells(1).Text
Server.Transfer("SearchDetails.aspx")
End If
End Sub
I'm not sure why my ItemCommand code won't fire. Is the Page_Load datagrid bind code causing my problems?