views:

35

answers:

1

I have a gridview0 in a multiview and when I click select on a row I have the GridView0_SelectedIndexChanged sub change to a different view in the multiview, which has a different gridview1 but the same datasource as gridview0. This is when it errors out and it displays the invalid column name error, with the column name being the datakeyname of the first gridview0 row that was selected.

The first image is the view of gridview0, and the second is the error that occurs when I click select. Thanks!

image one

image two

Protected Sub GridView0_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridView0.SelectedIndexChanged

    Dim ISTag As String = GridView0.SelectedDataKey.Value.ToString
    Dim type As String = getTypeMethod(ISTag)
    filterText.Text = type
    If (type.Equals("Computer")) Then
        InventoryComputer.SelectCommand = "SELECT * FROM T_Computer WHERE ISTag = " & ISTag
        MultiView1.ActiveViewIndex = 8
    End If
End Sub
A: 

Adding a new datasource and setting the where to the original gridview worked.

Shawn