473,761 Members | 4,082 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Contolling #of rows in a Web Listbox Control

Hi,
There is a ROW property on the Web Listbox control within VB.Net. The
description states it is "The number of visible rows to display".

I have tried setting this property in many different ways. It does not
appear to do much of anything. I was trying to use it to control the
actual size in rows of the list box on the Web page. But the size of the
Web listbox seems to be fixed and controlled by the size of the control set
in the designer. If there are more than the rows possible within that
control size, a scroll bar, permits an unlimited number of rows.

The setting of the Listbox.Row property does not appear to make any
differences good or bad. Can you control the size of the listbox using this
property? If so, what is a valid format for the setting? Just setting a
number does not appear to do anything.

thanks,
hugh
Nov 21 '05 #1
3 2428
Hi Hugh,

Welcome to MSDN newsgroup.
As for the ROW property, do you mean the "Rows" property of the ASP.NET
ListBox webserver control? This property is used to control how many rows
will be visible in the ListBox (when there're many items) and the Rows
propety is actually render as "size" attribute in clientside html like
below:

ASPX: <asp:ListBox id="ListBox1" Rows="3" runat="server">
||
V
HTML: <select name="ListBox1" size="3" id="ListBox1">

Also, to make sure the "Rows" property work as expected, we need to prevent
the ListBox being applied other size css attributes like:

<asp:listbox id="ListBox1" runat="server" Rows="3" Width="72px"
Height="72px">

in such condition, the Rows setting will be override by the "Height"
attribute which is rendered as:

<select name="ListBox1" size="3" id="ListBox1"
style="height:7 2px;width:72px; ">

If you have anything else unclear, please feel free to post here. Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
| From: "Hugh O" <Hu****@newsgro up.nospam>
| Subject: Contolling #of rows in a Web Listbox Control
| Date: Tue, 13 Sep 2005 16:32:00 -0400
| Lines: 20
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| Message-ID: <#1************ **@TK2MSFTNGP09 .phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.langua ges.vb
| NNTP-Posting-Host: pcp01784214pcs. audubn01.nj.com cast.net 68.46.176.167
| Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGP09.phx. gbl
| Xref: TK2MSFTNGXA01.p hx.gbl microsoft.publi c.dotnet.langua ges.vb:105552
| X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.vb
|
| Hi,
| There is a ROW property on the Web Listbox control within VB.Net. The
| description states it is "The number of visible rows to display".
|
| I have tried setting this property in many different ways. It does not
| appear to do much of anything. I was trying to use it to control the
| actual size in rows of the list box on the Web page. But the size of the
| Web listbox seems to be fixed and controlled by the size of the control
set
| in the designer. If there are more than the rows possible within that
| control size, a scroll bar, permits an unlimited number of rows.
|
| The setting of the Listbox.Row property does not appear to make any
| differences good or bad. Can you control the size of the listbox using
this
| property? If so, what is a valid format for the setting? Just setting a
| number does not appear to do anything.
|
| thanks,
| hugh
|
|
|

Nov 21 '05 #2
Steven,
Thanks a lot. I would have NEVER on my own figured out that the ASP.Net
Listbox.Rows property fails to work when you do not accept the default shape
in the designer phase. The Rows property is not adequately documented in
the Help facilities and it makes no mention of the impact of using other
size attributes. I have now learned that in the designer phase you can
make the Listbox wider but you can not drag the listbox longer or in any way
set the Height property.

Thanks again.
hugh
Nov 21 '05 #3
Thanks for your followup.

En yes, sometimes the design-time added position/size attributes dosn't
seem quite well. That's why it's removed in the VS.NET2005 since for
webpage, the flowlayout is the most natural one which is accepted by most
web developers.

Thanks again for your posting.

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| From: "Hugh O" <Hu****@newsgro up.nospam>
| References: <#1************ **@TK2MSFTNGP09 .phx.gbl>
<LM************ *@TK2MSFTNGXA01 .phx.gbl>
| Subject: Re: Contolling #of rows in a Web Listbox Control
| Date: Wed, 14 Sep 2005 13:14:13 -0400
| Lines: 13
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| Message-ID: <uA************ **@tk2msftngp13 .phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.langua ges.vb
| NNTP-Posting-Host: pcp01784214pcs. audubn01.nj.com cast.net 68.46.176.167
| Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GP08.phx.gbl!tk 2msftngp13.phx. gbl
| Xref: TK2MSFTNGXA01.p hx.gbl microsoft.publi c.dotnet.langua ges.vb:105704
| X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.vb
|
| Steven,
| Thanks a lot. I would have NEVER on my own figured out that the ASP.Net
| Listbox.Rows property fails to work when you do not accept the default
shape
| in the designer phase. The Rows property is not adequately documented in
| the Help facilities and it makes no mention of the impact of using other
| size attributes. I have now learned that in the designer phase you can
| make the Listbox wider but you can not drag the listbox longer or in any
way
| set the Height property.
|
| Thanks again.
| hugh
|
|
|

Nov 21 '05 #4

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

Similar topics

3
5628
by: mike | last post by:
How do i do the following: lbCountries.SelectedValue = "826"; lbCountries.SelectedValue = "840"; Basically i've set the selectmode to multiple and want to select multiple values of the listbox on databind. the problem is this only selects the last row "840" -- i would imagine this
2
3426
by: Luca | last post by:
Hello, I'm using a windows form in which there is a standard ListBox control. I want to add/remove objects from the ArrayList associated to the ListBox, and I want the ListBox immediately shows graphically the change: e.g. if I remove an element from the ArrayList object, then that element should not be no more displayed in the list box. Actually i'm using this code below:
2
23361
by: John R. | last post by:
I want to have a listbox that shows a checkbox and a textbox. I created a user control that has a checkbox and a textbox in it and have been trying to add it to a listbox but I can't get it to show up for each item I add to the listbox. foreach (Column column in columns) { ColumnsListBox.Items.Add(column.Name); ColumnsListBox.Controls.Add(new ColumnListControl(true, column.Name,
8
2884
by: Oddball | last post by:
Ok - I have a ListBox control and I'm ready to write my own DrawItem event handler. What I want to draw as the item is another control. I have created a user control that I would like to list in this listbox but I can't for the life of me figure out how to draw the control inside ListBox... I get as far as: private void lbImageList_DrawItem(object sender, System.Windows.Forms.DrawItemEventArgs e)
4
2445
by: Justin | last post by:
I have a web form that allow the user to add dates to a listbox control and they are also added to an arraylist at the same time but I do not know how to select all the rows into one string then save to the database. Any suggestions?
18
2026
by: Dave Sauny | last post by:
Ok, its a friday, I'm at work and I cant get this to work: I have 3 listboxes on one tab control page. when i select an item in listbox1 i want whatever is selected on the other 2 listboxes unselected. when listbox2 is selected, 1 and 3 should have no items selected and the same with listbox 3. Sounds simple... should be simple! I have tried listbox.clearselected(), listbox.selectedindex=-1 and beating it with a large stick. But so...
3
1329
by: Danny Tuppeny | last post by:
Hi all, Something bugs me. It's the whole "not accessing a control from a non-UI thread" thing... In my world, all properties would be safe from all threads (maybe they'd be locked internally?), and paint methods/events would automatically be marshalled into the UI thread. It seems this isn't the case (I'm sure there are reasons, but I don't know
8
6386
by: nirdeshonline | last post by:
Hi, I have added a simple listbox in windows form under c# 2.0. It contains a collection of approx 10 strings as list items. Now when i resize the form whole listbox flickers. Please tell me any feasible solution, i need to use a checked listbox which also has same flickering problem on resize. Thanks & Regards
1
1859
by: Fix_Metal | last post by:
Hello all. I'm new to this group :) I have a problem with javascript language. I'm making an .asp page with some integrated Javascript functions. The page consists of some HTML selects and a table. The table is obviously populated from a database :) so it is dynamic. The database contains a field containing some names. This field is not a PK, thus the names can be repeated very easily). I want the user to be able to see all the rows...
0
9522
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
9336
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
10111
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
9902
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
8770
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
7327
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
6603
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
5215
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...
3
3446
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.