B
BJF
My goal is to have a master/detail setup with the master being a GridView,
and the detail being either a DetailsView or a FormView. I've gotten this
to work as long as the relationship between the two controls only relys on
one key field ( the datasource has a 'where' clause with only one field in
it).
I need two keys from the GridView table to control what shows up in the
detail control. I've set the GridView to use a table that has a two-field
primary key (TAPENO and RECORDING), and both fields show up in the
DataKeyNames property of the GridView. When I create the datasource for the
FormView control, I set the 'where' clause to request two fields. The
wizard generates two lines in the WHERE clause text box:
SQL Expression: Value:
[TAPENO] = @TAPENO
GridView1.SelectedValue
[RECORDING] = @RECORDING GridView1.SelectedValue
When I run the application, the FormView control shows no contents when I
select an item from the GridView (master) control. I know the FormView is
showing up, there some HTML for it as a table, but no rows or fields.
Like I said, I've been able to do this in a one-key-field scenario, but not
in a two-key-field scenario.
Any suggestions?
Ben
and the detail being either a DetailsView or a FormView. I've gotten this
to work as long as the relationship between the two controls only relys on
one key field ( the datasource has a 'where' clause with only one field in
it).
I need two keys from the GridView table to control what shows up in the
detail control. I've set the GridView to use a table that has a two-field
primary key (TAPENO and RECORDING), and both fields show up in the
DataKeyNames property of the GridView. When I create the datasource for the
FormView control, I set the 'where' clause to request two fields. The
wizard generates two lines in the WHERE clause text box:
SQL Expression: Value:
[TAPENO] = @TAPENO
GridView1.SelectedValue
[RECORDING] = @RECORDING GridView1.SelectedValue
When I run the application, the FormView control shows no contents when I
select an item from the GridView (master) control. I know the FormView is
showing up, there some HTML for it as a table, but no rows or fields.
Like I said, I've been able to do this in a one-key-field scenario, but not
in a two-key-field scenario.
Any suggestions?
Ben