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
ADVERTISEMENT
Oct 19, 2010
I am just getting back into VB.NET, and I need to ask a question. I am doing a project for a class which requires iterating through 360 items in a scrollable control that will pause every so often. I am thinking I might use either a ListView or GridView, but I am not sure if this is the right way to go or if I need to use a different control all together.
View 3 Replies
Sep 13, 2011
Can I safely modify -I mean: remove and re-add on a different index position- any item that I iterate over using a For Each loop in VB? We are talking about the VB Microsoft.VisualBasic.Collection class.And if yes: Is this by design, or an implementational detail, that I am building upon then?
View 3 Replies
Jun 30, 2011
Say I have three lists containing multiple objects. Lets also assume they each contain the same number of items. [code]...
Now say I have a dataGridView that I have defined as having three columns. Is there a way to assign the contents of each of the lists to each of the three columns (e.g. column 1 = myList1, column 2 = myList2, etc.) without iterating through each of the lists? I know I could define a dataTable, create the columns, and iterate through each of the lists...then associate the dataTable to the dataGridView's dataSource. However, I don't want to iterate through the lists since in my real application, these lists are large and the iteration would take too long. I'm just wondering how to assign these lists to a column in a dataTable in bulk.
View 2 Replies
Jan 26, 2010
have a collection that stores structures of data. my problem is that, after i have populated my collection, i do not know how i could change or update the data stored in the collection.my structure of data looks like this:
Structure tType1
Dim ID as Integer
Dim QTY as Integer
[code].....
View 6 Replies
Oct 29, 2009
I've hit a problem with the way I am using generics and I suspect that my design isn't quite right. I have a base class
AbstractBaseClass
inherited by
InheritingOneClass
[code]....
I have a generic list IList(of T as AbstractBaseClass) which I am populating with instances of the various inheriting classes. Now I can cycle through the list BUT depending on which subtype the item is, I want to pass the item to various functions (or instantiate various classes) which access properties/methods of the inheriting Class. I don't really want to have to use a Select Case and list all the potential types of the Inheriting classes. Is there a mechanism I can put in place to automate this?
View 13 Replies
Apr 19, 2009
I want to place a image with the text "NO IMAGE" in my Repeater when there is no image.What changes must i make in order to achieve this? I want my Repeater datasource to point to an image inside my IMAGE folder in my root directory.
[Code]...
View 1 Replies
Sep 27, 2011
i have a database that stores clients, categories and sub categories, what i am doing is creating a form that programatically creates tab pages on a tab control for each category and a checked list box with each sub category as an item. so that when the form is displayed it only shows categories and sub categories relevent to the client.
Dim tabpage as Integer = 0
ab.Open("select distinct category from etc etc", connectionstring)
While Not ab.EOF
TabControl1.TabPages.Add(ab.Fields("category").Value)
[Code].....
View 2 Replies
Apr 11, 2012
How can I access rep_DataSimilarToBacthid ? I need to bind the GridView and call GridView RowDataBound or InitializeRow
[Code]...
I am using VB.Net with Framework Version 2.0.
View 1 Replies
Mar 15, 2011
I am using a repeater to build a custom table. However, I can't figure out how to make the table show subtotal if the next rows tour does not match the previous rows.
Something similar to that.
row1 tour1
row2 tour 1
tour1 subtotal
[Code].....
but this shows all the data in the nested repeater not the ones that match the parentrepeater fields for example tour,theme,dep7 should match in the child repeater
View 1 Replies
Sep 21, 2011
I'm having a problem with this code in the highlighted line(*); getting the error in the heading.
Dim htmlarraylist As New List(Of iTextSharp.text.IElement)
htmlarraylist = *HTMLWorker.ParseToList(New StreamReader(tempFile), New StyleSheet())*
[Code].....
View 2 Replies
Mar 27, 2009
I have a parent repeater with nested repeaters.My problem is I am trying to use 'Next' and 'Previous' buttons to rebind my repeater (rptTabContent) and thus the inner repeaters also, but when I try to manipulate the state of these links during the ItemCommand event they are overwritten by the bind.
View 1 Replies
Feb 5, 2011
[code]...
What's really the point in using the former?It's hard to use linq if I used the former. I have to convert that to an array first which is difficult because there is no (asarray) function.I think I would change all of my code that's using System.
Collections.Specialized.StringCollection to System.Collections.Generic.List(Of String)
View 2 Replies
Feb 7, 2012
Ok so my issue is I have three repeaters. Within that repeater I have another repeater and a third one in the second. There is more in between but that's not relevant. Below the HTML is my VB code. My issue is that rptCrashPercentageAvg reutrns Nothing. How can rptCrashStatsDisplay access rptCrashPercentageAvg?
<asp:Repeater ID="rptCrashStatsDisplay" runat="server">
<ItemTemplate>
<asp:Repeater ID="rptCrashPercentage" runat="server">
[code].....
View 1 Replies
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
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
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
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
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
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
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
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
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
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
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
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
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
May 9, 2009
How do i delete multiple items that matches some words, Like [code]
View 6 Replies
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
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