.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Home >> Forum >> ASP.Net >> Post New QuestionBookmark and Share Subscribe to Forum

implement Drop Down list item in Gridview

Posted By: Nachi     Posted Date: March 17, 2012    Points:5   Category :ASP.Net

implement Drop Down list item in Gridview

Hi All,

I have a big clarification in grid view, this question something interesting and also little duff.

I have table of three field namely id, name and destination

I know already how to add and display this three columns in grid view including check box & button for each row generated and fetching third column in drop down list.

I need to know when i checked the check box of particular column,then the drop down list item is selected and last finally the button is click, the output needed is another grid view (nested grid view)displaying the select row information.

I know its very interesting and simple for experts? I have attached the file for your reference.


Please change the dot and slash to keyboard character and download it....

Author: Pawan Awasthi             
Posted Date: March 24, 2012     Points: 20   


Hai Nachi,

The first thing, you need to do is that you need to fill the dropdon list while crating the row in OnRowCreadtedEvent. So in the gridView OnRowCreated event, find the GridView using the FindControl method and then you can add the items.
After getting, in the on row databound event, you need to make the item as the selected item.
see below onRowCreated event as:

protected void gvPoolStatus_RowCreated(object sender, GridViewRowEventArgs e)
if (e.Row.RowType == DataControlRowType.DataRow)
DropDownList ddlDesig = (DropDownList)e.Row.Cells[3].FindControl("dd_designation");
if (ddlDesig != null)
ddlDesig.Items.Add("items");//add the items from the list or dataset

see below for the onRowDataBound event as :
protected void gvPoolStatus_OnRowDataBound(object sender, GridViewRowEventArgs e)
if (e.Row.RowType == DataControlRowType.DataRow)
DropDownList ddlDesig = (DropDownList)e.Row.Cells[3].FindControl("dd_designation");
if(ddlDesig != null)
ddlDesig.SelectedItem.Text= e.Row.Cells[3].Text;
Hope it will help you.

Pawan Awasthi
(Whats App)+91 8123489140
(cell No.) +6 0143651476

Skype: Pawansoftit
Author: chikkanti             
Posted Date: June 06, 2012     Points: 20   

Post Reply

You must Sign In To post reply
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend