Hi I got an error when try to click the linkbutton at the column. This error only occur when I expand all the detail table at the same time. The error shown is Object reference not set to an instance of an object. Below is my codes. Please help. Thanks
Protected Sub lnkID_Select(ByVal sender As Object, ByVal e As EventArgs)
Dim MerchantID As String = ""
Dim BranchNum As String = ""
Dim dt As GridDataItem = DirectCast(sender, LinkButton).NamingContainer
MerchantID = CType(RadGrid1.Items(dt.ItemIndex).FindControl("lnkMerchantID"), LinkButton).Text
BranchNum = CType(RadGrid1.Items(dt.ItemIndex).FindControl("BranchNum"), Label).Text
Response.Redirect("~/Master/Merchant/MerchantDetail.aspx?MerchantID=" & MerchantID & "&BranchNum=" & BranchNum & "")
End Sub