473,799 Members | 2,741 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with databound listbox.

I have a strange problem with a databound listbox. It may be because of how
I use it, but I am stumped by this behavior. Here is the scenario:

I have a multiselect databound listbox that belongs to a panel control. In
the Page_Load event, the panel listbox control may be moved from one panel
to another depending on selections that the operator makes. Everything
seems to work fine except for one thing. The selections that are made in
the listbox are not retained on postback. They are always cleared. If I
remove the databinding from the listbox and place items in it manually, then
it works fine. I do not do databinding if Page.IsPostback is set to true.
Can someone explain why it does not retain selections on postback? I
suspect it is because I am moving the listbox control to a new parent, but I
don't understand why this is causing a problem.
--
-----------------------------------
Ken Varn
Senior Software Engineer
Diebold Inc.

EmailID = varnk
Domain = Diebold.com
-----------------------------------
Nov 18 '05 #1
0 1276

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

Similar topics

0
1304
by: JB | last post by:
I have a databound listbox that is causing my form to hang when I call the show method. The list box is bound using the following code: _dataView.Table = _data.Tables; lboUsers.DataSource = _dataView; lboUsers.DisplayMember = "FullName"; then when I call form.Show(), the form shows up, but hangs before it draws any of the controls on the form. Is there any valid reason for this? Has anyone ever seen this before? I've written the same...
1
2059
by: Wade Beasley | last post by:
I have developed a Windows Forms application with C#. On the windows form I have a master list box with the names of people the user can select from and when selected it calls a Select in SQL server to gather the appropriate information. It is then populated onto a multi-tab portion on the right of the screen. On the 3rd tab I have 2 multi-select listboxes. The problem is on the first time I go to the tab for the first name the 2...
1
4122
by: Tariq | last post by:
Hi, I have a list box that is bound to an arraylist, but when the data changes the listbox does not refresh. ----------------------------------------------------------------------------- al = new ArrayList(); al.Add("1");al.Add("2");al.Add("3");al.Add("4");al.Add("5");al.Add("6"); listBox1.DataSource = al; label1.Text = al.Count.ToString();
4
2310
by: Harold | last post by:
I have read the following article http://www.4guysfromrolla.com/webtech/073101-1.shtml. I added the empty selection as the first option. When I click submit without choosing anything it does not return my empty string but the 2nd value in listbox. When the page reloads it selects the 2nd option by default even thou my Empty field is in the list. What do I have to do to get the empty field and databound data to act as one?
2
1735
by: Kiran | last post by:
Hi, This is something weird I noticed recently in ASP.Net. I have created typed dataset and I have filled the data. when a postback happens, the data of the dataset is lost. Is there a workaround for this. I have a databound listbox. When a postback happens the values in the listbox are still there.
2
3847
by: tangokilo | last post by:
Hello and thanks for your help, I have the following Listbox created in VisualStudio 2003 designer, desiring to select multiple entries from that list: ------------------------------- ListBoxUser.Location = New System.Drawing.Point(16, 240) ListBoxUser.Name = "ListBoxUser" ListBoxUser.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended ListBoxUser.Size = New System.Drawing.Size(136, 147) ListBoxUser.TabIndex = 6
1
2058
by: Andreas Zita | last post by:
Hi I have a simple problem scenario with yet no good solution: I want: A sorted (by name) and bindable typesafe collection (of students) which I can set as DataSource to a ListBox. When editing a students name in a databound textbox, the name in the listbox should update and also resort itself (while also keeping this student in focus). I dont want to use DataGridView since its to complex. I just want a simple
1
1465
by: Gerwin Berentschot | last post by:
Hi all, I am looking for a databound listbox control that can be as easily used as the listbox control that comes with Ms Access (with as less programming as possible). I would like this listbox to have drag and drop capabilities, column and row format, etc. Does anybody know which control (commercial of non commercial) is suitable for my needs? Regards, Gerwin Berentschot
6
6658
by: =?Utf-8?B?SnVzdGlu?= | last post by:
Hello: Does anyone know how I can create a multi-column listbox in VB.Net (Windows)...I am using VS.Net 2003. If there is another control available that can be databound with multiple columns, I would be interested in looking into that as well. Here is the code I have (it cannot display multiple columns)...
0
9688
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9544
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
10490
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...
0
10259
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9077
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...
0
6809
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();...
0
5467
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5589
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2941
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.