473,395 Members | 1,412 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

problem for dropdown list in itemtemplate

Hi, All,
I have two dropdown lists in itemtemplate in a datagrid. for example, dropA
and dropB. also, for the dropdown, I set < Runat="server" AutoPostBack="True"
OnSelectedIndexChanged="some event name"> When users selects an item, it will
do a postback to server. Before the postback completes and the page
refreshes, click any dropdown menu again (either dropA or dropB) the frame
page will become blank out. I must to click F5 or refresh button to reload
the page. the problem is the two dropdown menu are in itemTemplate, so, they
may have more than one row. How could I disable the dropdown menus once they
has been click and enable them later.

any ideas?

Thank you for your help

Brian

Feb 14 '06 #1
2 1353
Hi Brian,

in your DDL event, it should look like EventName(object sender,
System.EventArgs e), cast sender to DDL. And then disable it.

DropDownList ddlA = (DropDownList)sender;
ddlA.Enabled = false;
HTH

Elton Wang
"Brian" wrote:
Hi, All,
I have two dropdown lists in itemtemplate in a datagrid. for example, dropA
and dropB. also, for the dropdown, I set < Runat="server" AutoPostBack="True"
OnSelectedIndexChanged="some event name"> When users selects an item, it will
do a postback to server. Before the postback completes and the page
refreshes, click any dropdown menu again (either dropA or dropB) the frame
page will become blank out. I must to click F5 or refresh button to reload
the page. the problem is the two dropdown menu are in itemTemplate, so, they
may have more than one row. How could I disable the dropdown menus once they
has been click and enable them later.

any ideas?

Thank you for your help

Brian

Feb 14 '06 #2
Thanks, Elton,
I tried what you told me but it doesn't work. The codes looks like,

Protected Sub EventName_SelectedIndexChanged(ByVal sender As Object, ByVal
e As System.EventArgs) Handles DataGridName.SelectedIndexChanged

Dim ddlA As DropDownList
ddlA = CType(sender, DropDownList)
ddlA.Enabled = False
......
......
End sub

after I clicked the dropdowns first time, it still can be selected for the
second time. it looks like the enable of dropdown hasn't been set to false.

did I miss something?

thank you!

"Elton W" wrote:
Hi Brian,

in your DDL event, it should look like EventName(object sender,
System.EventArgs e), cast sender to DDL. And then disable it.

DropDownList ddlA = (DropDownList)sender;
ddlA.Enabled = false;
HTH

Elton Wang
"Brian" wrote:
Hi, All,
I have two dropdown lists in itemtemplate in a datagrid. for example, dropA
and dropB. also, for the dropdown, I set < Runat="server" AutoPostBack="True"
OnSelectedIndexChanged="some event name"> When users selects an item, it will
do a postback to server. Before the postback completes and the page
refreshes, click any dropdown menu again (either dropA or dropB) the frame
page will become blank out. I must to click F5 or refresh button to reload
the page. the problem is the two dropdown menu are in itemTemplate, so, they
may have more than one row. How could I disable the dropdown menus once they
has been click and enable them later.

any ideas?

Thank you for your help

Brian

Feb 14 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Michelle | last post by:
Hello, I put a dropdown list in ItemTemplate Column. I can select its value from the dropdown list and store in a dataset, but when I retrieve records from dataset, it doesn't show up in the...
0
by: Mark | last post by:
Hi, I have a datalist that contains a textbox as well as a dropdown list. For each single row in the datalist the associated dropdown list can have at least one value What I would like to be...
0
by: Darren Clark | last post by:
Is it possible to nest a drop down list in a repeater? (also the repeater has a nested repeater) The code i am using looks like.... i get an error saying that Exception Details:...
6
by: Jenna Alten | last post by:
I have a datagrid with a template column that contains a dropdown list. I currently fill and display the dropdown list on the page load. This is working correctly. I am NOT using an Edit Column. I...
1
by: sck10 | last post by:
Hello, I am using the following in a GridView. Currently, I am using a dropdown that pulls the Name of the person, given the Employee ID. I am doing this in both the ItemTemplate and the...
4
by: Dabbler | last post by:
I have two tables I'm editing in a Gridview. The VANS table contains a key to the other LESSOR table. I would like to use a dropdown list to select the LessorId value while displaying the Lessor...
2
by: Peter | last post by:
ASP.NET 2003 In the DataGrid how do I select current cell value in the dropdown box when I click on the edit link, currently when I click on the edit link in the DataGrid the dropdown box...
0
by: Mike C | last post by:
I've been grappling with this for days and hope someone has some suggestions. I have a datagrid that I'd like to place entirely in edit mode so people don't have to update data row by row. I've...
0
by: Chicagoboy27 | last post by:
I am wondering how to set an object datsource or any data source for a dropdown list that is a details view. Here is a brief set up. I have a details view that lists a bunch of information. when a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.