الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

درس كيفية عمل لينك داخل ال gridview لصفحة تعرض detailsview

مغلق
بدأه birdonwire في 12 ديسمبر 2006 · 4 رد · 2,662 مشاهدة · في ASP.NET
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

here i am going to explain how to add links to grid view

i have a jobs table that has the following fields

jobs_table.jpg

in a gridview i need only the job title and date_added fields to be displayed where the job_title will be a link to view all details of the specified job i.e. to get all other fields from the database

so i will start with dragging a gridview control to add it to the page and add new data source

gridview.jpg

i will choose the data source to be the jobs table and also check the fields i need to display in the gridview which will be the id,job_title and date_added

select_query.jpg

i will test the query to see if it's working

test_query.jpg

after everything is ok i click on the gridview and select edit columns

edit_columns.jpg

in the edit columns screen i will add HyberLinkedField and edit it's properties as shown in the next figure

fields.jpg

where the DataNavigateUrlField will be the id to send it as URL parameter to the next page

and the DataNavigateUrlFormatString will be the page where i am redirecting to which will be view_details.aspx?id={0} where 0 is the first column specified in the query which is the id of the job

and the DataTextField will be the job_title field where it will be displayed as a link

and in the HeaderText i will write jobs

then i will remove the job_title from the selected_fields pane as it will be displayed in the hyperlink column so everything will look like the following

final.jpg

then i view the page in the browser

page_in_browser.jpg

next i am going to create the view_details.aspx page where it will display the full data about the select job

i will add gridview control to this page and choose the data source to be the job table and select which fields i want to display

view_details.jpg

then i will click where to choose the selected row according to the id sent from the previous gridview control on the browse_jobs.aspx

where.jpg

and i click add so that where clause is added to the query then click ok

Mohamed BADR

Senior PHP developer

http://www.mohamedbadr.com

#2

شرح موفق

جزاك الله خير

#3

Nice Artilce ! ;)

"وماتوفيقي إلا بالله عليه توكلت وإليه أنيب"

#4

جزاك الله الف خير ننتظر بقيت دروسك

#5

شرح ودرس أكثر من رائع , شكراً لك يالغالي

بس الله يعينك على المشرفين ليه ما حطيت الصور في سيرفر الفريق العربي خخخخخ

تحيه طيبه

... والله أعلى وأعلم ...

w w w . a l t h a r i . c o m

a b d u l m a l i k @ a l t h a r i . c o m

هذا الموضوع مغلق.

مواضيع مشابهة