Asp.net - How To DataBind Multiple Items

Mar 12, 2011

I'm running the following query:

' Show which halls they are eligible for.
Dim dbRooms As New pbu_housingEntities
Dim gender As String = Session("gender").ToString

[Code]....

View 1 Replies


ADVERTISEMENT

Asp.net - When Using Datasource And Databind To Set Items In A Dropdownlist - Index Is Always The Value Of First Item

Jan 18, 2012

I am trying to use datasource and bind in my application to set a dropdown list to the results of a query. The dropdownlist populates correctly (shows each different type_name in the set) but later when I use ddltype.selectedvalue - I am always getting the value from the first item in the dataset. Here is the code.

[Code]...

View 1 Replies

C# - Get A Boundingbox For Multiple Items In Wpf?

May 24, 2011

I have several items, i want to calculate a minimum rectangle in which they can be fit, but items are rotated to some degree, or skewed or both. So how do i get the least rectangle which can contain all ?

View 3 Replies

Change A Value On Multiple Items?

Feb 3, 2009

I have not programmed since the late 90's (VB 6.0)Using Visual Basic 2008 Express, I'm creating a simple program but have one question:Is there a quick way to change a value on multiple items? For my program, I need to make a group of text boxes (anywhere from 14 to 546 unique boxes) "Enabled = True" or "Enabled = False" depending on a user selected value.

In a little more detail: The user selects the number of data rows on one tab. On the other tab are 40 rows of text boxes (14 boxes per row). If the user selected 15 rows, every row below 15 should be "Enabled = False".Thus far, I've coded a bunch of if-thens that run each time the user changes the selected rows (a line for each text box that makes it enabled or not). There are then 40 if-thens with lots of code in each.
I am sure there is an easier way to accomplish my goal without using hundreds of lined-up text boxes.

View 19 Replies

Add Items In A ListView That Has Multiple Columns?

Jul 28, 2011

I have a ListView called lv with three columns. What's the quickest and easiest way to add items in it during runtime? I am using WPF.

View 1 Replies

Add Multiple Items To A Dynamic List?

Apr 19, 2010

How would I add multiple items to a dynamic list without having to use the .Add method for each one?[code]...

View 10 Replies

Adding Multiple Items From One Listbox To Another?

Jul 12, 2011

I am able to only move single items from one listbox to another with this code. I tried with both MultiSimple & MultiExtended SelectionMode.

How do I select multiple items and then move them?
Private Sub cmdAdd_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs

[code]......

View 1 Replies

Adding Multiple Items To A Listbox?

Aug 10, 2011

(Visual Basic 2010)I'm trying to add multiple item to a listbox from a text file. The program will show help for computer tasks.

Textfile:

Add new event to calender#Sync calender to phone#Print something from the internet

Code:

Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
UpdateTopicList()
End Sub

[code]....

View 7 Replies

Adding Multiple Items To Listview?

Sep 17, 2010

So, i'd like to ask you! How can i add new listview items to a ListViewItemCollection (or something better), and than add the items in the collection to a ListView. The point of all this is to add listviewitems from a background worker.

View 2 Replies

Controlling Multiple GroupBox Items?

Apr 6, 2009

I was wondering if there is some type of code that could control mutiple textboxes in multiple Groupboxes, basically what I want to do is be able to trigger all the textboxes in each of the groupboxes to become non visible based off of a choice in a combobox...here is what I have so far but i'm still way off

Private Sub Combo1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs Handles Combo1.SelectedIndexChanged.

[code].....

View 4 Replies

Disable Multiple Items From DropDownList?

Jun 6, 2011

I would like to disable a specific items from DropDownList. I have below code but it does not working. DropDownList have 5 items.And,I'm getting error:Index was out of range. Must be non-negative and less than the size of the collection.Parameter name: index

Protected Sub CheckBox1_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
Dim X As Integer = 0 <> 1
DropDownList1.Items(X).Enabled = False
End Sub

But, if I add a different value for X, then it disable 1st and 2nd item.

Protected Sub CheckBox1_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
Dim X As Integer = 0 or 1
DropDownList1.Items(X).Enabled = False
End Sub

My goal is if I would have a 365 items in DropwDownList to disable items for example between 120 and 150.

View 1 Replies

Gridview Templatefield With Multiple Items?

Jun 19, 2012

I am creating a web application in ASP.net/VB.NET and I have an issue with the gridview.Currently, I have the gridview populated with data from the DB and I've also coded the update button to allow the user edit any necessary information through a form that pops up.[URL]...

What I'd like to do, if possible, is add a button to the two right columns(I already put one in the Dock Out Time column) which will be invisible if the column is set or will set the current time to the column. Setting the time for those two columns is already handled through the update form, but my supervisor asked me to try and see if this was possible.

Those two Time columns are Templatefields(since I format the display time from what is actually in the DB) and I added an asp button in the ItemTemplate for that Set Button in the picture.Is this even possible to do and if so, how would I access this button in the code behind so I can add functionality(setting the time and hiding it if the column is not null)If it's not really possible to have two items like this in a templatefield I can just make 2 extra columns for these buttons but I think this would look much cleaner.

View 1 Replies

How Can Select Multiple Items In ListView

Oct 6, 2011

I have a ListView box on my project, which is filled with another function.I need it so that when you press Button1, messageboxes pop up with all of the selected items in it.

So basically, I select multiple items in my ListView, press Button1, and the MsgBox appears showing me what I've selected.[code...]

View 7 Replies

Listview Remove Multiple Items?

Jul 10, 2006

i've got this code to remove all selected items in a listview... but i like to know if there is any more simple code to do this ...

My code:

Dim i As Integer
With frmMain.FeedsList
For i = 0 To .Items.Count - 1

[code]....

View 14 Replies

Remove Multiple Items From Checkedlistbox

May 9, 2009

How do i delete multiple items that matches some words, Like [code]

View 6 Replies

Removing Multiple Items From A List Box At Once?

May 2, 2010

If I have 3 times selected and when I click "submit" for example I want all my selected items to be removed, but when I try to do this only my first selected item is removed.

ListBox.Items.Remove(ListBox.SelectedItems)

How do I remove all 3 items from the list box at the same time?

View 2 Replies

Saving Multiple Items To SQL Database

Nov 1, 2011

I have some items in my listbox which I will store everyone of them into my database, what I am doing now is looping the box and call my database saving logic to save every single item. I thought this is pretty inefficient, is there anyway that I can use to batch save my items so that I don't open and close the connection as many times as my items.

For Each item In outletToBox.Items
.CamCode = Items.ToString
.CamCampaignAutoID = retID
.CamRemarks = uitxtCamRemarks.Text.Trim
'---use savetable object to save to database table---
Next

View 3 Replies

Selecting Multiple Items Using Checkbox?

Aug 26, 2011

i just need to select from multiple checkboxes, this checkbox contains days from Monday to Saturday. Here is the idea on what will happen if I select Multiple days, it will save on a field on my database with colon(;)

View 6 Replies

VS 2008 ContextMenuStrip With Multiple Items

Feb 1, 2010

I have 9 small PictureBoxes that all have the same ContextMenuStrips. I need to be able to change the Backcolor property of the PictureBoxes via a ColorDialog. How would I determine which PictureBox has been selected so I can apply the correct PictureBox with the chosen color?

View 3 Replies

VS 2008 For Each Multiple Listbox Items

Oct 3, 2011

I got 3 listboxes.

[Code]...

So basicly I want to loop all items from listbox1 with each item in listbox2.

View 9 Replies

Asp.net - Error Cannot Have Multiple Items Selected In A DropDownList?

Mar 14, 2012

This is my code and i am getting an error ..Cannot have multiple items selected in a DropDownList. when the page loads it select "ALL" in DDLModality but when i change DDLModality.selectedvalue to any "value" then no error but again when i change to "ALL "getting the error.

onchange of DDLMODALITY submit the form
form1.target = "";
form1.action = "";
form1.submit();

[Code]...

View 2 Replies

Asp.net: Iterating Over Multiple Repeater.items Collections?

Apr 1, 2011

I have a number of idential repeaters, and I need to iterate through all of the items. I currently have:

For Each item In rpt1.Items
.do some stuff
Next[code]....

Is there a simple way to reduce this to a single For Each ... Next loop?

Edit: There are a number of local vars involved in "do some stuff", which is why I can't just pass the item into a function - the call would have to include about 8 ByRef params.

View 3 Replies

Change Multiple Items Simultaneously In DataGridView?

Feb 7, 2012

I'd like to allow the user to select up to an entire column of cells and type and/or paste a single value that would then change the value of all the selected cells in the DataGridView to the value that was typed or pasted. I understand this is probably two separate answers, but perhaps if there is a way to set the contents of the clipboard with the value typed, I was thinking it may work well to identify both things I want to do.

View 3 Replies

Forms :: Checking Listbox For Multiple Items?

Feb 17, 2011

I am making a virtual crafting application (similar to that done in Minecraft)

currently I have made a test "crafting recipe" which checks if the listbox (mixbox) has 1 window, 1 door and 1 wheel. the code looks like this:

If mixbox.Items.Contains("window") Then
If mixbox.Items.Contains("door") Then
If mixbox.Items.Contains("wheel") Then

[Code]....

View 3 Replies

Forms :: Drag Multiple Items From One Listbox To Another?

Mar 10, 2011

I've looked everywhere on the internet for multiple items drag&drop between listboxes and found only examples showing single item drag. I know how to make a single item dragdrop operation between two listboxes using MouseDown, DoDragDrop, DragEnter, DragDrop Now what I'm looking forward to learn is the ability of dragging more than one item from one listbox and dropping them in another listbox

View 2 Replies

Listview DragDrop Multiple Items Not Working?

May 6, 2008

I trying to do a drag drop from a listview in one form to another instance of the same form (same application running twice).I have it working with single items selections, but I want to make it work with multiple selections. 289508(VS.71).aspxThis works if I drag/drop onto itself (the same form), which I don't want, but I need it to work across instances.During debugging it seems the code DragDrop code just quits at the line during the drop:Dim myItems() As ListViewItem = e.Data.GetData("System.Windows.Forms.ListViewItem()")Any ideas what is wrong or how to drag/drop multiple items in a listview between apps?

here's my code:
Private Sub ListView1_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles ListView1.DragDrop

[code]....

View 5 Replies

Multiple Data Items In Single Field?

Apr 30, 2009

What I'm trying to do - VB 2005 express and sql 2005 express editions - Trying to set up just a basic hardware/software inventory program. As is I've got separate tables for computer and software licenses...with ComputerID and LicenseID primary keys respectively...where I'm bumping into walls is that I wanted to be able to link them together with a foreign key, for example the computer record would have a foreign key for LicenseID and when a license would get installed the ID would go in and there'd be a nice pretty link. However I run into scenarios where a computer might not have any software installed...or might have more than 1 software item. Or a single software item may be installed on 1 computer, multiple computers, or nowhere. It possible to have that single foreign key field link to multiple records from the opposite table?

What was originally suggested to me was to have a 3rd table called Installations. It'd have 3 rows...one named InstallationID as the primary key, and 2 foreign key rows named ComputerID and LicenseID that linked to the other tables, so that when a license was installed, a record would be added to the Installations table, and later on when we wanted to see where all a particular license was installed or what licenses a single computer had, the table could be filtered by computer ID or license ID and all matching records could be displayed. When I tried that out though I'm having a heck of a time getting the correct items to display.

Just as a basic test i set up a new form and dragged the tables onto it from the Data Sources window using "Details" view for each of them, so that it set up the table adapters and binding sources and navigator for me. I got rid of the auto-added labels + textboxes on the form and added just a couple new textboxes, 1 linked to the licenseID and one to another row i had in that table for productkey...tested it and it moves through the records fine and the correct data shows up in each box to correspond with the other. now though I'd like to add another control to display each of the ComputerIDs that are linked to the particular license being displayed in the other controls via the foreign keys routing through the Installations table, but I'm not having much luck.

View 1 Replies

Multiple ListBox - User Cannot Select Same Items

Jun 9, 2010

I currently have two list boxes that have the exact same items in each. I don't want the user to be able to select the same item from both list boxes.

My code:
listbox1.Items.Add("SSS")
listbox1.Items.Add("AAA")
listbox2.Items.Add("SSS")
listbox2.Items.Add("AAA")

I'd like the user to not be able to select AAA & AAA from different list boxes, just SSS & AAA. I have way more items just thought I'd shorten it.

View 6 Replies

Multiple Textboxes Bound To Different Items In List?

Oct 1, 2010

On my form I have 3 textboxes. They get their data from a database query. The trick is the database may return 1 result or up to 3. If the query returns only 1 result, I want the first textbox populated, 2 results, 1st and 2nd textbox populated, etc... I also want to be able to track CurrentItemChanged Event for updating purposes. My initial thought was to use a list object as the binding source but how would I cycle through the list if it returns more than one so that I can assign the values to the 2nd and 3rd textboxes or if data is entered in to a blank textbox I want the currentitemchanged

View 6 Replies

Remove Multiple Items Or Rows From Listbox?

Nov 19, 2011

I want to delete Multiple rows of listbox, I tried this

For teller = 0 To 170 Step 1
ListBox1.Items.Remove(teller)
Next

But that doesn't work. How do I delete the first 170 rows in my listbox? :)

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved