0

I am new to asp.net though not to asp. I want to display two gridboxes, the first with master records and the second with child records linked to the master table id. The idea is to change the child records when the parent record is selected, or ideally, when the page index is changed. Is there any way to do this without a complicated song and dance? I am not using MS SQL Server, but MySQL, so it is not possible to specify a parameter in the Data Source configuration dialog.

1
Contributor
2
Replies
3
Views
7 Years
Discussion Span
Last Post by jimib
0

I solved my own problem, like this in case it will help another beginner:

Protected Sub ParentGridView_PageIndexChanging(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewPageEventArgs) Handles ParentGridView.PageIndexChanging
ParentGridView.PageIndex = e.NewPageIndex
ParentGridView.DataBind()
Childdatasource.SelectCommand = "Select * From child where id_parent="+ ParentGridView.Rows(0).Cells (1).Text
End Sub

where

ParentGridView.Rows(0).Cells (1).Text is the index field of the parent grid

0

P.S.
Childdatasource.SelectCommand = "Select * From child where id_parent="+ ParentGridView.Rows(0).Cells (1).Text
has to be placed in the page load event as well for initial functionality...

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.