can anyone help me
-
I am trying to get a gridview to work using a selectedIndexChanged event handler. I want to "select" an item from the category then using a GridView, i want to display the products and offer the user a way to select a product. Upon selection, i want to handle the event by using the SelectedIndexChange event and display the primary key/productId for the product selected. My code does not seem to be working. I'm getting a null reference exception. I'm new to visual studio, it seems easy until i try and get something to work. here is my code so far
Partial Class _Default
Inherits System.Web.UI.PageProtected Sub SqlDataSource1\_Selecting(sender As Object, e As SqlDataSourceSelectingEventArgs) Handles SqlCategories.Selecting End Sub Protected Sub GridView1\_SelectedIndexChanging(sender As Object, e As GridViewSelectEventArgs) Handles GridView1.SelectedIndexChanging Dim intProductID As Integer = Nothing intProductID = GridView1.SelectedDataKey.Value Label1.Text = intProductID.ToString End Sub
End Class
I have a screen shot of my design view but do not see a way to post it here.
-
I am trying to get a gridview to work using a selectedIndexChanged event handler. I want to "select" an item from the category then using a GridView, i want to display the products and offer the user a way to select a product. Upon selection, i want to handle the event by using the SelectedIndexChange event and display the primary key/productId for the product selected. My code does not seem to be working. I'm getting a null reference exception. I'm new to visual studio, it seems easy until i try and get something to work. here is my code so far
Partial Class _Default
Inherits System.Web.UI.PageProtected Sub SqlDataSource1\_Selecting(sender As Object, e As SqlDataSourceSelectingEventArgs) Handles SqlCategories.Selecting End Sub Protected Sub GridView1\_SelectedIndexChanging(sender As Object, e As GridViewSelectEventArgs) Handles GridView1.SelectedIndexChanging Dim intProductID As Integer = Nothing intProductID = GridView1.SelectedDataKey.Value Label1.Text = intProductID.ToString End Sub
End Class
I have a screen shot of my design view but do not see a way to post it here.
-
Please use the correct forum: http://www.codeproject.com/Forums/1646/Visual-Basic.aspx[^]; this is not a Visual Studio issue.
I am doing the project in Visual Studios =/ Where did you move my question to? I can't find it.
-
I am doing the project in Visual Studios =/ Where did you move my question to? I can't find it.