Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Basics
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
ASP.NET 3.5 Basics If you are new to ASP or ASP.NET programming with version 3.5, this is the forum to begin asking questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 27th, 2008, 02:17 AM
Registered User
Join Date: Mar 2008
Location: madurai, tamilnadu, India.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to ilayaraja
Default Two DropDownList Inside a Gridview


for Creating Menu in Asp.net

 <asp:TemplateField HeaderText="Order ID">
 <asp:Label ID="lbliOrder" runat="server" Text='<%#Eval("iOrder") %>'></asp:Label>
 <asp:DropDownList ID="ddlOrgId" runat="server" DataSource="<%# DropDownData %>"
 DataTextField="strPageHeader" DataValueField="strPageHeader"
 AutoPostBack="True" onselectedindexchanged="ddlOrgId_SelectedIndexChan ged"
 SelectedValue="<%# DropDownSel %>">
 <asp:DropDownList ID="ddlstParent" runat="server" DataSource="<%# DropDownData %>"
 DataTextField="strPageHeader" DataValueField="strPageHeader"
 AutoPostBack="true" onselectedindexchanged="ddlstParent_SelectedIndexC hanged">
            <asp:TemplateField HeaderText="OrderList">
                        <asp:Label ID="lblOrderList" runat="server" Text='<%#Eval("iParentOrder") %>'></asp:Label>
                     <asp:DropDownList ID="ddlstEOrder" runat="server" DataSource="<%# MyData1 %>"
                      DataTextField="iParentOrder" DataValueField="iParentOrder"

                      SelectedValue="<%# DropDownSelParent %>" Visible="False" >
                     <asp:DropDownList ID="ddlstOrder" runat="server" DataSource="<%#MyData %>" DataTextField="iParentOrder"
                             Visible="False" AutoPostBack="True" >

my table structure is given below

ikeyid Bigint,iOrganizationKeyid BigInt, strPageHeader varchar(200), strPageUrl varchar(250),iOrder int,iParentOrder int

values as follows
ikeyid iOrganizationKeyid strPageHeader strPageUrl iOrder iParentOrder
1 0 Home -1 1
2 0 Mail -1 2
3 0 Aboutus -1 3
4 0 Yahoo 2

iKeyid is the Parent
iOrder is the Child

if iOrder is -1 is said to be a Parent and it has a iParentOrder value also

if iOrder is not -1 it will not have iParentOrder

im having a Admin Dash Board to insert update delete
in whichi im having 2 dropdown list for iOrder and iParentOrder
iOrder will display the Parent Header value in the dropdown according to the value in IOrder. if it is -1 is a display as "New Parent.." if im selecting this object the dropdown list for

iParentOrder.Visible =true;
iParentOrder.Visible =False;

it is working if the dropdownlistselected index changed.

During Edit:
dropdownlist SelectedValue is not visible even it shown "NewParent.." as Selected Value at that time SelectedIndexChange event will not fire
How to make my DropDownList in Edit time to Display on Checking the Value

if(iOrder==-1 or ddlstOrder.Tex=="New Parent..")

Anyone Help to solve this issue

with regards,

  #2 (permalink)  
Old March 28th, 2008, 06:53 PM
Registered User
Join Date: Feb 2008
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts

Best I can tell that should be working but I ran the same code here and got the same non-results. Hopefully someone else can chime in.

  #3 (permalink)  
Old May 3rd, 2008, 08:21 PM
Authorized User
Join Date: Apr 2008
Location: Rockville, MD, USA.
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts


I have used the following code to put drop down list inside of a grid. I hope this helps.

            <asp:BoundField DataField="INTAKE_DATE" DataFormatString="{0:d}"
                HeaderText="INTAKE_DATE" SortExpression="INTAKE_DATE" />
            <asp:TemplateField HeaderText="STATUS" SortExpression="STATUS">
                    <asp:DropDownList ID="STATUSDropDownList" runat="server" AutoPostBack="true"
                        SelectedValue='<%# Bind("STATUS", "{0}") %>'>
                        <asp:ListItem Text="ADD DROP DOWN LIST ITEMS" Value="ADD DROP DOWN LIST ITEMS" Enabled="true"></asp:ListItem>
                     <asp:DropDownList ID="STATUSDropDownList" runat="server" AutoPostBack="true"
                         SelectedValue='<%# Bind("STATUS", "{0}") %>'>
                         <asp:ListItem Enabled="true" Text="ADD DROP DOWN VALUES"
                             Value="ADD DROP DOWN VALUES"
  #4 (permalink)  
Old December 5th, 2008, 06:26 PM
Registered User
Join Date: Dec 2008
Location: beni suif, , Egypt.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts

i want to put dropdownlist inside gridveiw
and by changing selectrd value in dropdown rest of colum of gridview change


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
DropDownList Inside FormView Problem frogosteve ASP.NET 2.0 Basics 0 April 12th, 2007 10:30 AM
DropDownList Inside a datagrid @shish ASP.NET 1.0 and 1.1 Professional 3 January 29th, 2007 07:24 PM
dropdownlist inside datagrid myunus General .NET 11 October 29th, 2006 07:37 AM
DropDownList inside a GridView aidoco ASP.NET 2.0 Basics 0 October 13th, 2006 04:24 AM
dropdownlist inside datagrid shaileshmark General .NET 5 June 27th, 2004 05:18 AM

All times are GMT -4. The time now is 01:32 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.