AspdotnetCodes.com
Search
Articles
Books
Resources
Asp.Net News
Downloads
Free Tech Magazines
Asp.Net Web Hosting
Archives
Softwares
Newsletter
Suggest Us
Link to Us
Feeds Subscription
Articles
Questions & Answers
Tips & Tricks
 about gridview
Posted by subhranshu on  4/1/2008 5:49:19 AM Category: Asp.Net 2.0
Add to my favorites
Email to friend
i have some other problems in datagrid. in my gridview i have to add dropdownlist in every rows. and in every rows the dropdown datas are coming from master tables(foreign key tables).so i am getting confused how to solve this problem.please help me it is urgent.

Post Your Reply Post New Question

 Viewer's Reply
Fill the DropDown box in OnRowDataBound event
Answered By Moderator1 on 4/1/2008 8:27:12 PM
Hi,

I suggest you to fill the Master's Table Dropdown list box in OnRowDataBound event.
Step 1: Find the control
DropDownList DropDownList1 = (DropDownList)e.Row.Cells[0].FindControl("DropDownList1");
DropDownList1.DataSource = your_DataTable_Filled_with_Master_Info
DropDownList1.DataBind()

That's it. for the DataTable pass conditions based on the Foreign Reference Key.

Good Luck..
 
Post Your Reply If you still have problem, post it again under this reply for better response.

 
Sponsored by
Sexy Web Design - Free 71 Page Preview!
The Beginner's Guide to Joomla
The PHP Anthology: 101 Essential Tips, Tricks & Hacks, 2nd Edition - Free 207 Page Preview!