GridView DetailsView Master Detail question

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
 
C

Coskun Sunali [MVP]

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.
 
G

Gregory A. Beamer

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top