[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Get parameter value from detailsview row

Posted on 2007-04-01
2
Medium Priority
?
456 Views
Last Modified: 2012-08-13
I have a detailsview on my aspx page.
The last row is a boundfield that I have set to invisible (I need the value but not to show it).

Next to this I have a gridview. It's datasource is a stored procedure with a single input parameter.
I need this parameter to be the (invisible) value from my detailsview.
I've set the datasource for the gridview and set the parameter to come the control detailsview1 but I can't see a way to specify the actual value/row to feed the gridview with.
0
Comment
Question by:QPR
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 15

Accepted Solution

by:
igor_alpha earned 2000 total points
ID: 18834323
Hi QPR,
Using hidden field in detailsview for parameter passing is not elegant solution.
Better to specify datafield which you hide as DetailssView datakey. You can do it through property pages of DetailView or in aspx. Let say hidden field is "id":
<asp:DetailsView ID="DetailsView1" runat="server" Height="50px" Width="125px" DataKeyNames="id">
        </asp:DetailsView>
Now, you can specify DetailsView.SelectedValue as parameter in dataSource. Again you can do it through property pages of dataSource or in aspx:
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server">
            <SelectParameters>
                <asp:ControlParameter ControlID="DetailsView1" Name="newparameter" PropertyName="SelectedValue" />
            </SelectParameters>
        </asp:ObjectDataSource>
0
 
LVL 29

Author Comment

by:QPR
ID: 18834394
perfect!
I really do need to learn what all these attributes mean for the controls!
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question