i have records in gridview , showing results of different students, roll no. wise along with name and gpa, so i want to view detail marks sheet of each rollno. present in gridview, when i click on roll no. of any student. how ? in asp.net ?

Recommended Answers

All 5 Replies

use a detailsview control along with the gridview.

@jORGEM: yes , that's fine but i mean that how i would know that on which rollno. visitor clicked ? or viewing whose details ?

If I understand you correctly, you do understand that you can use a detailsview in combination with a gridview and that the data shown in the detailsview is based on a selection in the gridview.

Ok, if this is the case, using the wizard when adding new controls...

what I have done in the past is add the details view after my gridview is created. When creating the detailsview datasource, going through the SQL steps (Configure the Select Statement Window), I click on the "Where..." button, and in the "Add Where Clause" window, I click on the source dropdown, choose "Control", on the ControlId dropdown, choose my Gridview, finish it by clicking add for "GridView1.SelectedValue".

Make sure my gridview has a "Selected" control so that when I click on it, the details are shown in the detailsview.

This tutorial should get you on the right track.
http://www.asp.net/web-forms/tutorials/data-access/masterdetail/master-detail-using-a-selectable-master-gridview-with-a-details-detailview-vb

Awesome !!! got it !!!
solved
thanks man !!!

Good to hear!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.