473,670 Members | 2,636 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

About WebForm ListBox question ?!

Dear All,

I used ListBox(Selecti onMode=Multiple ) to develop my web application, but I
encountered some problems..

1. I can use ClearSelection method to unselect all the selected items but
how shoud I do if I want to select all the items of the ListBox.
2. Is there a better way to get all the selected item which user select,
because I think to scan all the item selected property is not very suitable.

Thanks....

Regards,
Paul
Nov 20 '05 #1
1 1057
Hi Paul

1.)
Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click

Dim lbi As ListItem

For Each lbi In ListBox1.Items

lbi.Selected = True

Next

End Sub

2.)
ListBox1.Items. CopyTo(myItems, 0)

HTH - OHM


"Paul Tsai" <mj*@seed.net.t w> wrote in message
news:Os******** ******@tk2msftn gp13.phx.gbl...
Dear All,

I used ListBox(Selecti onMode=Multiple ) to develop my web application, but I encountered some problems..

1. I can use ClearSelection method to unselect all the selected items but
how shoud I do if I want to select all the items of the ListBox.
2. Is there a better way to get all the selected item which user select,
because I think to scan all the item selected property is not very suitable.
Thanks....

Regards,
Paul

Nov 20 '05 #2

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

Similar topics

1
1973
by: cloverme | last post by:
Hi, I need help populating a listbox from a database on a webform. I created a an access database with a table, fields and data. Then I created a WebForm in vb.net and added a DropDownList control to the page. Then I created a data connection to my table... I right clicked and told it to generate a dataset (which it created dataset1).
1
1876
by: Chris | last post by:
Hi, I have an application written in ASP and I am converting to ASP.NET in the old ASP page users can add items to a listbox control. When the user hits the "submit" command button on the form. It fires a stored procedure in the SQL Server Database. The listbox items are converted into a comma delimited string and sent to stored procedure. This SP constructs a temp table variable out of the
0
903
by: Paul Tsai | last post by:
Dear All, I used ListBox(SelectionMode=Multiple) to develop my web application, but I encountered some problems.. 1. I can use ClearSelection method to unselect all the selected items but how shoud I do if I want to select all the items of the ListBox. 2. Is there a better way to get all the selected item which user select, because I think to scan all the item selected property is not very suitable.
1
2577
by: Tom Wild | last post by:
Hi I have a listbox on a webform which has Autopostback set to true. When the user selects an item in the listbox and the form reloads, the listbox scrolls to put the selected item as high up as possible. Is there any way to turn off this behaviour? Thanks Tom
2
1878
by: Matt Theule | last post by:
I need to be able to allow users to drag files to a list box on a web page. To this end, I created a Windows Control and hosted it in a WebForm. When the file is dropped onto the listbox, the path of the file is truncated down to 8.3 format (with the ~1 at the end). When the Windows control is hosted in a windows form (for testing purposes) the full path is displayed. Is there some setting that will allow the full path to be displayed...
1
1217
by: cloverme | last post by:
I have a couple of questions about coding (using vb.net) to a webform. Thanks in advance for your help. I'm a little new to vb.net, but a VB veteran. 1) When the page loads, how can I generate html at the top of the page? For example... If some variable = 1 then the html at the top of the page will be "hello"
1
1124
by: Kristian | last post by:
Hello, When clicking on a button the selected item from the 1st listbox is supposed to be added to the 2nd listbox: The code: Private Sub btnInfo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnInfo.Click Dim sVal As String Me.lstKatInfo.SelectedIndex = -1 sVal = Me.lstKat.SelectedItem.Text Me.lstKatInfo.Items.Add(sVal)
3
8164
by: James Radke | last post by:
Hello, I was curious, is it possible to create drag and drop interface from listbox to listbox on a webform application (i.e. vb.net)? Basically the application would need to load multiple listboxes with values from a database, allow the user to drag and drop from a listbox to a different listbox and would 'move' the item and update the database accordingly? If so, would anyone have any examples of how to do this?
9
1864
by: James Radke | last post by:
Hello, I would like to create a sorted listbox which has one property that I can set to true or false to show if the listbox should be sorted (I may potentially add another one for the sort direction - asc, or desc). Then, if it should be sorted, everytime an item is added to the list via Items.Add or or deleted via items.remove, I would like it to automatically resort the list. I have created the base class below... but this only...
1
7000
by: mikev | last post by:
Hi all I have a listbox which is 5 rows high. There are 5 list items. The first one is selected. I wish to click on a button and have the selection focus on the listbox removed. Removed, unselected, nullified?! cheers
0
8901
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
8814
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
8660
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
7415
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
6213
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
4209
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
4390
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2799
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
2041
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.