GridView DetailsView Master Detail question

  • Thread starter Thread starter hon123456
  • Start date Start date
H

hon123456

Dear all,

I have seen DetailsView with a SelectParameter from
GridView. like follows

SelectCommand="SELECT * FROM [Customers] WHERE ([CustomerID] =
@CustomerID)">
<SelectParameters>
<asp:ControlParameter ControlID="GridView1" Name="CustomerID"
PropertyName="SelectedValue"
Type="String" />
</SelectParameters>

I want to Know how Can I generate the above code with Smart Tag of
DetailsView or Graphically
using VB2008. Or I need to put the above code manually. Thanks
 
Hi,

Are you sure that this code belongs to the DetailsView? I think it should
belong to some kind of "DataSource" control. For instance SqlDataSource or
ObjectDataSource. And then it should be assigned as the data control of the
DetailsView.

If that is the case, you can achieve what you are trying to do using the
Smart Tag feature of the DataSource control. All you have to do is to click
"Configure Data Source" button (wording can be different).

Please let me know if it does not help.
 
Dear all,

I have seen DetailsView with a SelectParameter from
GridView. like follows

SelectCommand="SELECT * FROM [Customers] WHERE ([CustomerID] =
@CustomerID)">
<SelectParameters>
<asp:ControlParameter ControlID="GridView1" Name="CustomerID"
PropertyName="SelectedValue"
Type="String" />
</SelectParameters>

I want to Know how Can I generate the above code with Smart Tag of
DetailsView or Graphically
using VB2008. Or I need to put the above code manually. Thanks


Based on your code, it appears you wish to select out of the Grid to get
details. Fair enough.

Here is MSDN's advise, with the GUI goodness:
http://msdn.microsoft.com/en-us/library/ms972814.aspx


Here is a site that shows how to do it in code:
http://www.dotnetjohn.com/articles.aspx?articleid=236



--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
| Think outside the box! |
*******************************************
 
Back
Top