DetailsView question
-
I developed originally with VS 2003. There I was happy using DataSet with DataAdapters, and the old DataGrid control. For "detail view" of selected item in DataGrid, I rolled my own viewer. Now I am revisiting and attempting to get "up-to-date" with the new TableAdapters, GridView & DetailsView. I had assumed that DetailsView would be tied to GridView and could show just the selected item's details. I see it actually displays (one of) many items, which I don't really want/need, but never mind. Now, my adapters fill a dataset, and that is what I have bound the GridView to (via its DataSource). I do *not* want it to issue a SQL command directly. Still less do I want the DetailsView to issue its own SQL command, I want it to work off the filled DataSet. That rules out the examples way, which allows binding to a *parameter* taken from the selected item in the GridView and passing that as an argument to a SQL command. My problems/questions/work-arounds are as follows: 1. I can bind a DetailsView DataSource to same DataSet/DataTable, but can find *no* means of setting which item/row is selected in the DetailsView. All its "selected" stuff seems to be read-only (whereas I can select in a GridView). Am I missing something? 2. Although I wouldn't mind DetailsView navigation between rows, I only *need* it to show the selected row. If I have to go down this route: 2a. I could create a copied table with just one row in it, but that seems ugly, and it only contains a *copy* of the row anyway. 2b. I can use a DataView to select one row and bind the DetailsView to that. But I don't see the DataView being used much any more. 2c. I could create a "Business Object" to do this, and look into its "SelectCommand" (or whatever). My searches have revealed nothing. Don't understand why this isn't a common requirement. Please let me know if I have missed something for #1, or which way from #2 I should be pursuing? Thanks.