Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. DetailsView question

DetailsView question

Scheduled Pinned Locked Moved ASP.NET
questioncssdatabasevisual-studiowpf
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    JonB
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups