473,662 Members | 2,693 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DropDownList (with AutoPostBack) in a DataGrid

Hi,

I have a Search page, which has a Search Button which whenclicked, Binds a DataGrid to the Data returned from Search(whichimp lies that I am not Binding the Grid in Page_Load method). Inthe EditTemplate, I have a DropDownList with AutopostBack Trueand I have also defined a SelectIndexChan ged event Handler forit. Along with the DropDownList, I also have a two ListBoxes andAdd and Remove Buttons. The first ListBox should be filleddepending upon which option is selected in the DropDownList(I amfilling the List Box in the Item_DataBound method of theDropDownList ). The problem is, when the OnSelectIndexCh anged ofthe DropDownList is getting fired, I am losing all the Controlsin the EditTemplate.

I thought that maybe if I Bind the Grid in Page_Load(Out sideif(not postback) construct) I might solve the problem. But whenI tried that, when OnSelectIndexCh anged event of theDropDownList gets fired, I am having my controls in place, but Iam losing my selection I make in the ListBox(thats because, I amBinding the Grid on each postback......w hich fires theItem_DataBou nd event handler)....... .....

Please Help
Thanks in advance,

Jaleel
--------------------------------
From: Jaleel Syed

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>PWqyfYKn/kSakHvYPyFtcQ== </Id>
Nov 18 '05 #1
0 1149

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

Similar topics

2
3326
by: buran | last post by:
Dear ASP.NET Programmers, I have the following problem. I have a datagrid (ID: grdAllActions). This datagrid has two template columns: one column with the dropdownlist control (ID: ddlPS) and another with a checkbox control (ID: cbPS). My goal is to enable or disable the dropdownlist control when the user checks or unchecks the checkbox. I am trying the following code: <asp:TemplateColumn HeaderText="Payment Status"> <ItemTemplate>
2
2391
by: Shiju Poyilil | last post by:
Hello, I have a datagrid with only one row and its having 2 dropdownlists, I need to populate the secodn dropdownlist on the basis of the selection in the first dropdown. but I am not able to populate the second dropdown, as its not bale to find the specified control, even though the dropdownlist with the specified name exists in the datagrid. my .aspx page code goes like this
2
2343
by: Luis Esteban Valencia | last post by:
Hello I have a datagrid with a dropdownlist that has the products, another column has the price of the product and when the user changes the product it also must change the price how can I achieve that. Thanks Datagrid html
0
1527
by: Luis Esteban Valencia | last post by:
Hello. I have a datagrid with one row. I have a button that adds a new row. I am trying to implement that when the user selects one product it must change the price on the quantity column. Anyway when the user selects the first dropdownlist the dropdownselected_indexchanged is firring but when the user chagnes the second dropdownlist its not firing. aahh! if the user selects any of both dropdownlist the datagrid stays with only one row?...
3
1283
by: Tim::.. | last post by:
Hi... Can someone please tell me what I'm doing wrong here... I have a dropdownmenu populated from a database! The idea is that a user selects an option from the dropdownlist which then loads the selected data into a datagrid... For some reason I can't get the data in the datagrid to load! Not really shaw how to do it.... I presume it would work on SelectedIndexChanged but the
0
2271
by: Tand35006 | last post by:
Hi, I hope some one can help with this. I have a basic webform with 2 DropDownLists and a single DataGrid. What I am trying to do is populate the first DDList from a dataset on Form_Load. I then want to use this 1st DDList to populate the 2nd DDList via the SelectedIndexChange Event. So far so good. all works up to this point. The next thing I'm trying to do is to use the 2nd DDList value in a queery to populate the Datagrid also...
1
578
by: sergeyr3 | last post by:
Hey guys, I am new here, so i hope this works out: I have a datagrid which I populate with data from XML file. In EditItemTemplate I have a dropdownlist. How do I fire myDataGrid_UpdateCommand upon SelectedIndexChanged event in the dropdownlist? thank you. -Sergey <ASP:DataGrid id="myDataGrid" runat="server"
2
16084
by: glenn | last post by:
Hi folks, I am trying to determine which item in a DropDownList Web control has been selected. I have posted an OnSelectedIndexChanged subroutine in my code with a reference to the subroutine in my asp tag as shown here: <asp:DropDownList id="ddlTo" runat="server"
1
1329
by: glenn | last post by:
Hi folks, I need to have two ddl's in one DataGrid cell. The first ddl has a list of company names and the second has a list of contact names that work in the company name that was selected in the first ddl. Any replies will be greatly appreciate. Here are 3 functions / subroutines that do the following:
15
3101
by: glenn | last post by:
Hi folks, I have a DropDownList in a DataGrid that is populated from records in a database. I want to add a value that might be a string such as "Select a Company" for the first item since an OnSelectedIndex event is not fired if you select the first item. Does anyone know of an easy way to do this?
0
8345
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8857
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8547
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8633
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7368
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6186
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5655
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2763
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1999
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.