.net - WinForms - Passing Same List As DataSource For Two Different Listboxes?

Dec 30, 2009

Check out the simple code below :

[code]...

What happens is that when the Item2 is selected in the first listbox, the second listbox automatically changes its selected item to the Item2. This happens just the same with the other listbox.

View 3 Replies


ADVERTISEMENT

Sql Server - Appending An ADO.Net Datasource In Winforms?

Jan 5, 2011

I am working with two seperate SQL statements when user conducts a search on my winforms app.A user can search based on an OrderNumber, OrderDate, ClaimNumber, ClaimDate, CustomerID, CustomerPhone One SQL statement returns the OrderNumber (in case the user searched based on OrderDate), which is used to execute another SQL statement, which returns the details about the order.

The results are populated in a gridview.Once the first statement is executed, I have a DataSource (DataSet). How can I append that datasource to display the fields from the second statement as well, keeping in mind, that the first statement could return multiple records, all of which will need to have the appropriate order details correctly linked.

View 1 Replies

Winforms - .net, Combobox.datasource Will Change Selected Index?

Mar 1, 2012

Let me try to describe my problems in the simplest way: I have combobox1 and combobox2. I hope to achieve two things: Combox1 is bound to list1 (a list of string). When a user selects an item in list1, list2 (a list of string) will be obtained from database and combobox is bound to list2.If user specifies text1 in combobox1 and text2 in combobox2, then these two values will be shown in the comboboxes regardless of the bound lists.

[Code]...

So the results of above code is that goal 1 is achieved, but goal 2 is never achieved. combobox1.selected index is always 0 and combobox2.selected index is always 0 too.

View 1 Replies

Show Yes/no In Bool Column Of Gridview Bound To Datasource In Winforms?

Mar 15, 2010

I have a gridview that is bound to a datasource (Windows Forms, VB.NET). One of columns is a property of type boolean, and I want to show "yes/no" in the column instead of 0/1 or "true/false". Is this possible? Can you edit displays of columns that are bound?

View 1 Replies

Array List And Multiple Listboxes?

May 27, 2012

I am pretty sure that I understand what needs to be done here but I'm not 100% sure on how to go about this.I have a list box that contains a list of url's for websites. 100 to be exact.I have a web request defined in a private sub.What I need to do is to loop through the listbox1, grab one url, place it into the variable of the request and then save that entire web request (with link) to string.In the end I will have all 100 url's put into their own web requests and feed back into an array which I can then put into some sort of multi-threading method.

View 4 Replies

Way To Select From A List - Aren't The Two Listboxes Getting A Little Old?

Dec 22, 2009

How many times have we seen this type of selector:

I was just about to start creating this in a WinForms app, when I thought that others may have some ideas for doing this better. We need it to sort - so the right hand list will need up/down buttons. But this seems so old school. I love devexpress components, and was thinking of asking them if they would consider adding a component that handles this functionality with a slick UI.

I am thinking that a graphical representation of the objects, and a graphical representation of the listboxes - that would be a more intuitive way to move items around. Has anyone seen an open source project like this?

View 4 Replies

Find A List Of Items Between 2 Listboxes Program?

Sep 15, 2011

I want to check for each item in list box if item exist then add it to listbox3[code]...

but it is very slow if there is way to search for list of items in listbox at once?

View 3 Replies

Passing Data Between Winforms And Webforms?

Mar 6, 2009

i'm planning on creating an application that uses both winforms and webforms and i have a few concerns before i proceed.1. is it possible to pass data between winforms and webforms?2. how about passing objects like connections, datatables, dataadapters etc. between webforms and winforms?3. i want a centralized authentication for all forms and webpages... meaning if i'm authenticated in a winform, i should also be authenticated when i launch a webform thru the winform and vice versa.

View 9 Replies

Winforms - Passing Values Out Of Forms?

Sep 8, 2011

I have a very simple windows forms setup. Form1 has a progress bar and a button on it, when clicked the button opens Form2 which also has a button on it that launches Form3. On Form3 is a button which I want to use to raise an event back to Form1.To achieve this can I add an event handler on form1 that will listen for an event of the type raised in form3? Or do I have to pass references to form1 to form2 and then from form2 to form3?

View 1 Replies

Passing Data From WinForms Application To MVC3

Dec 14, 2011

I am working on an application that has a Winforms and MVC3 Web component. We need to be able upload large files from the desktop to the web. I have tried the various VB 2010 WebClient and FTP FileUpload alternatives but continue to run into permission issues, even though the User-ID and password I supply are the same as those used by an FTP application that successfully copies files to the same MVC3 site. In my efforts to find alternative solutions, I have looked into using WCF which also seems complicated and problematic for this particular application.

The closest I have come to a solution utilizes HttpWebRequest on the Winforms application. The following VB 2010 and C# code (MVC3) successfully passes the Filename and File data to MVC3 (the InputStream contains the references and UrlEncode data, but the class containing the fields for this data are null. (I have also passed just the file data without the filename, and the uploaded file is successfully created from the InputStream - but the method variable is still null). Although I could pick apart the InputStream, I would prefer a more elegant alternative.

VB 2010 Winforms method:
Public Shared Sub FileUpload(ByVal Filepath As String)
Try
Dim Host = System.Configuration.ConfigurationManager.AppSettings("Host")
Dim url As String = Path.Combine(Host, "UI/FileUpload")
Dim request As HttpWebRequest = HttpWebRequest.Create(url)
request.Method = "POST"
[Code] .....

View 2 Replies

Passing List (Of ChildClass) As Parameter To Method Expecting List (Of ParentClass)?

Apr 12, 2010

I have implemented inheritance for two parent classes called Table and Field. Each parent class has several child classes. In the Table parent class, I created a method that expects parameter List(Of Field).

I get an error when trying to pass in parameter List(Of ChildField) to the method that expects a parameter of List(Of Field). The error message is as below:

Value of type
'System.Collections.Generic.List(Of
com.hlb.icisbatch.data.ChildField)'

[Code]....

View 2 Replies

List Was Refreshed, And Set The Datasource Again?

Oct 2, 2009

Is it a good idea to always use
[code]...


AllDefinitions.UserProfileseverytime?I had a problem when the list was refreshed, and I set the datasource again, the listbox showed Definitions.UserProfiles instead of the display name that I set.when I changed to always using the bindingsource, everything worked fine.

View 4 Replies

Removing Items From A List Box After Setting The DataSource

Sep 29, 2010

I have a small requirement and that is as follows:

I am populating a ListBox using stored procedures and the ListBox is populated as follows:

lstItems.DisplayMember = "emp_name"
lstItems.ValueMember = "login_id"
lstItems.DataSource = accessFunction.getEmployees

The ListBox gets populated correctly. After it is populated, i have a CommandButton and on the click event of the button, i want to remove selected items from the ListBox. So in the click event of the CommandButton, i have written the following code:

lstItems.Items.Remove(lstItems.SelectedItem)

After selecting an item from the ListBox and when i click the CommandButton, i get an error as "Items collection cannot be modified when the DataSource property is set".

how i can delete items from the ListBox.

View 2 Replies

.net - Sort Datagridview Columns When Datasource Binded To List(Of T)?

Feb 4, 2011

I have a datagridview with its datasource binded to a List(Of T). Now i would like to sort on any of the columns.My code:

'Database access : items = List(BlogPost)
dgBlogPosts.DataSource = items
'My BlogPost Class
Public Class BlogPost

[Code]...

View 1 Replies

List Of Structure As A DataGrid DataSource VB2010 Expres?

Feb 17, 2012

It's my first time playing with the DataGridView properly and I've hit a little snag...I need to display data in a DataGridView for ease of viewing, and I have a list of all the data. It's a list (of a structure), and I've got no idea how to do this. I can set the datasource as the list, but that doesn't work. I've read up on the topic but don't really understand. Am I forced to use classes not structures in this instance?

View 1 Replies

Asp.net - Escaping Html Character Strings From Dropdown List Box With Datasource

Aug 15, 2011

I have inherited a database that is moving to the web. Problem is that some of the string fields have html characters....

One example is....

"" without the quotes, IT WON'T SHOW UP IN HERE EITHER, trying something else. At any rate it has < and the > signs with text in the middle.

How can I escape any possible combination of html references.

SelectCommand="usp_getSingleStringData" SelectCommandType="StoredProcedure"
<SelectParameters>
<asp:SessionParameter Name="shrtText" SessionField="shrtText" Type="String" />

[Code]....

View 2 Replies

Winforms - List Data In Ms Sql?

Mar 10, 2010

Below is the code that I'm using in ms access to list the data according to what is selected in combobox and what is input in textbox.

My problem is there no commandbuilder in ms sql like in ms access, because it fails when I try:

dim mscombuilder as new sqlcommandbuilder

Here is the code:

''#list school
If ComboBox1.SelectedItem = "School" Then
Dim connectionString As String = "Data Source=SENBONZAKURASQLEXPRESS;Initial Catalog=testing;User ID=SenbonZakuraRew; Trusted_Connection=True;"

[Code].....

-There is no such thing as commandbuilder in the options that will appear. Do you know of any alternative of commandbuilder in ms sql?

View 1 Replies

.net - Drop-Down Image List In Winforms?

Aug 17, 2009

I'm trying to find a dropdown-style list for images I can use in a program of mine. It's fairly simple, just needs to display a few images in a grid with tooltips for each one, and I need to be able to get whichever one was last picked. For example,[URL] without the tab bar in it. Unfortunately my monetary budget is zero which means I can't purchase any controls?

View 2 Replies

WinForms Version Drop Down List

Dec 29, 2011

what is the Windows Form version of a Drop Down List? I would think a Combo Box, but that only seems to have a Text for the Items, not Text/Value (with Value being my primary key for the table I'm populating it from).

View 2 Replies

Passing A List's Enumerator To A Function

Dec 2, 2011

It looks like passing a list's enumerator to a function "byval" is quite different than passing it "byref". Essentially, regular "byval" passing will NOT change the caller's "enumerator.Current value", even if the function advances the enumerator. I was wondering if anyone knows why this is the case? Is an enumerator a primitive like an integer, without an object reference, and hence changes to it don't get reflected in the caller?This function is byval, and gets stuck in an infinite loop, spitting out "1" message boxes, because the enumerator's "current" never advances past 5.[code]The difference between the two functions is only whether the listFirstItem__ function accepts a byval or a byref enumerator.

View 2 Replies

Passing Parameters In SQLParameter As List?

Feb 8, 2011

I'm a beginner in VB.NET programming.. Please help me on how to pass SQLParameters in the below function..

This my code:

[Code]...

View 1 Replies

Passing Values From A List In Classes?

May 5, 2011

Im having a hard time trying to pass the values from a list inside of a class. Im trying to display multiple lines of values from a list inside of a class. My "client" class stores multiple lines of values into a list(of class transaction), with the number value(num) counting each transaction that it adds to the list.

Code:
Public Class Client
Private m_tranlist As New List(Of transaction)[code]....

im trying to display each line that is stored in the list in a label, and im having major trouble. I know all of the results are added into the lists, but how do i call the list in my main form in order to display each line of all of the values? Would I have to look up an index or something?

View 1 Replies

Passing List Of (integer) To Select Statement?

Mar 27, 2012

I have a function that returns a Datatable. I am passing a list of Integer as an argument. Then I thought tis would work.

Public Function GetEventsByEventType(ByVal EventType As List(Of Integer), ByVal DayInterval As Integer) As DataTable
Using con As New MySqlConnection(strCon)

[Code]...

as you can see. I use string.join to convert the list of integer to something like this. '1,2,3'. Problem is that is read as a string so i get the incorrect results. I need to have where EventType IN(1,2,3).

View 2 Replies

Passing String Variables In Array List

Jun 12, 2009

I'm having difficulty passing a variables in a an array list. [Code] I have to pass the paramvals array to the function. The paramvals array contains the string but not the value of variable of that name. For example, parmaval(0) should contain the value of vSequence but it showing me that it contains string "vsequence".

View 3 Replies

Search Array List By Passing Just The First Few Characters?

Jan 19, 2010

Following is the format of the data stored in my arraylist.

A-Amsterdam
B- Brussels
C-Canada

so and so forth. I wan to search my array list by passing just the first few characters till '-' So if i have something like AA-Test then i want to pass just 'AA' to check if it exists or not.

I know that i can use contains or binarysearch but it does not serve my purpose as they both compare objects.

View 2 Replies

Passing A System.Collections.Generic.List To Another Class?

Jun 10, 2012

I am trying to pass a System.Collections.Generic.List to another class. The collection is created in class2 and then passed into class1

[code]...

However I get a 'Null Reference Exception error' when I run the program. It seems f_str in the line 'For Each s As String In f_str' is null.

View 3 Replies

Passing Checked List View Items Into A Message Box?

Jun 10, 2011

I need help on passing checked list view items into one message box. my current code outputs multiple message box with the name of the item, depends on the number of items checked. what i need is to output into a message box all the items checked in my list view. the items should be posted in multiple lines. is there any way i can do it.

[Code]...

View 2 Replies

Change Microsoft SQL Server (SqlClient) Datasource To ODBC Datasource?

Jan 30, 2011

I use vb.net and windows form and sqlserver

I added Data Source(Microsoft SQL Server (SqlClient)) to my project. and now I need to change it to ODBC Data Source .

View 1 Replies

Displaying List Of Objects As Single Column In A Bound Gridview (Winforms)?

Mar 15, 2010

I have a gridview that is bound to a datasource on a Windows Form (VB.NET). The grid displays a list of "certifications", and each "certification" can be associated with many languages. So in the grid, I'd like to display "languages" as a column, and display a comma delimited list of the language names for each "certification".

In the "certification" class, one of the properties is a list of "language" objects, and each "language" has an ID (guid), name (string), and value (integer).

So in the datasource, I have the list of "languages", but I can't figure out how to display them in a column on the grid. The gridview won't let me add the language list property as a column.

So is the ONLY way to add a new property on the "certification" class, which returns a string that contains the comma delimited list, and show THAT on the grid? Or is there a way to display that list of "languages"?

View 1 Replies

Show Right Click Options On The Selected List View Record Only - Winforms C#.NET?

May 25, 2010

The ContextMenuStrip tied to the ListView control. However, the right click option (edit)appear where ever i click on the ListView area, this gives me exceptional error because the implementation of edit can only cope with a selected row. I only want it to appear when on a selected row (blue highlighted row). How can i do it?

View 1 Replies







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