473,769 Members | 4,297 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to get a column value that's not the displaymember from a list

Hi, I have a listbox with displaymember that I combined 3 columns together.
After the user made the selection I then need to get each one the of the
selected valuemember but then I don't want the displaymember. I only want 2
of the columns of that made up the displaymember. How can I refer to the
column value in each of the selecteditems?

Thanks, Alpha

strJoinTable = "";
strSelectedIDs. Append(" and l.jcodeID in (");

for (int x = 0; x < count; x++)
{
DataRowView rowView = this.lstLedger. SelectedItems[x] as DataRowView;
if (rowView != null)
{
if (x>0 )
{
strSelectedIDs. Append(", ");
strSelectValues .Append(", ");
}
strSelectedIDs. Append(rowView. Row[this.lstLedger. ValueMember].ToString());
strSelectValues .Append(rowView .Row[this.lstLedger. DisplayMember].ToString());
}
}//end for
Nov 17 '05 #1
0 979

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

Similar topics

27
3274
by: DraguVaso | last post by:
Hi, The Multi column comboBox is a well spoken control, that a lot of people desire, and a lot of people buildtheir own. I tested a lot of them, but none really was what i wanted to have. But does anybody knows where I can find the best Multi column combobox? One that supports a lot of columns, possiblities to get the values in each column for the selected item, adding a DataSource etc... It should be free, and if possible with the...
3
4271
by: Bill C. | last post by:
Hello, I know this has been discussed a lot already because I've been searching around for information the last few weeks. I'm trying to implement a DataGridComboBoxColumn class. I've found several examples on the web. They all seem to have problems, though that I've been unable to resolve. The most promising example I have found is at:
1
9381
by: Nikhil Patel | last post by:
Hi All, I am using a dll function that returns a two diamensional array containing BankNames and RoutingIds. I need to display BankNames and RoutingIds in two different comboboxes. When user selects an item in any of these two comboboxes, I need to pick the matching item in another combobox. Right now I store the values in a module level two diamensional array and when user selects a bankname or routingid I loop through the array to find a...
2
11313
by: Vern | last post by:
I created a table in a dataset that contains multiple columns. I attached a combo box to that table. Now I'm doing something wrong with trying to retrieve the value of the third column of the selecteditem. The datatable row contains the following columns, (ProductCd, Description, ProductType), the displaymember is Description, and the valuemember is ProductCd. I know how to get the values of the displaymember and valuemember, but how...
2
1546
by: Mike L | last post by:
How do I get the value in the first column of a combo box? cboRails.DataSource = ds1.Tables; cboRails.DisplayMember = "Description"; The combo box shows the "Description" column of my table. When the user selects from the combo box I want to grab the key. I tried cboRails.text but I get the value in the description, I want the value of the key, which is in column 1.
2
1222
by: Young J. Putt | last post by:
I've got a list box bound to a Datatable, like this: lstProjects.DataSource = m_oProjectSet.DataTable lstProjects.DisplayMember = "ProjectDesc" lstProjects.ValueMember = "ProjectID" I want to pass the ProjectID value (integer) of the selected item in lstProjects to another function. I assumed I could reference the integer value of the ProjectID column as
9
8500
by: Capt_Ron | last post by:
Hello, I would like to set the value of the item in the checked list box. I have a datareader that has 2 columns. PK and TEXT I want the TEXT as the Item and the PK as the Value. I can not find anywhere that I can SET the value. But I can GET the SELECTED ITEM VALUE. Any direction would be helpfull.
6
3565
by: Thief_ | last post by:
Can a combobox conatin more than one column? I want to store text in one column and in the other (hidden) column store integer values which are associated with the text. VB.Net 2003 -- | +-- Thief_ |
3
94267
by: sklett | last post by:
I'm changing from a DataGrid to a DataGridView and have run across a problem. The items that are bound to the DataGrid have an int Property that represents a primary key of a lookup table in my database. For example: table JobTypes 1 | Manager 2 | Controller 3 | Supervisor table Employee
0
9579
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
9422
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
10208
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
9855
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
8863
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
7404
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
6662
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
5444
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3558
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.