473,378 Members | 1,387 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Combobox question

Hi,

A simple question..
I have a datatable with 2 fields (SkuCode, ItemName)

I use a Combobox where the datasource is the DataTable and the DisplayMember
is the ItemName.
I add a TextBox where the user can type the SkuCode.
I would like to select the line in the ComboBox if the record exists.
I can not use the FindString method because the DisplayMember is not the
SkuCode.

Stan.
Nov 20 '05 #1
1 1050
Hi I try not to bind to datatables or dataviews directly

But this should work
Create a dataview based on the datatable
Bind the combobox to the dataview you should see all the items
then filter your dataview based on the text typed into the textbox

Else

This is what I do
Create a structure to contain the SkuCode and the DisplayMember
make the tostring return the DisplayMember
Add any enumirator etc you might want

Create a structure for each record and add it to a collection
then bind to the collection
you can then do something like this in say the textbox validated event

Dim t As Test = x(TextBox1.Text)

ComboBox1.SelectedItem = t

Assuming Test is the name of the structure and x is the name of the
collection
and you type a sku code in the textbox 1



"Stan Sainte-Rose" <st**@cyber972.com> wrote in message
news:ev**************@TK2MSFTNGP11.phx.gbl...
Hi,

A simple question..
I have a datatable with 2 fields (SkuCode, ItemName)

I use a Combobox where the datasource is the DataTable and the DisplayMember is the ItemName.
I add a TextBox where the user can type the SkuCode.
I would like to select the line in the ComboBox if the record exists.
I can not use the FindString method because the DisplayMember is not the
SkuCode.

Stan.

Nov 20 '05 #2

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

Similar topics

10
by: Mr. B | last post by:
I've been seeking the solution to this. But can't figure it out (sounds simple enough). When you Populat a ComboBox, you can select the initial displayed items on startup simply by setting the...
6
by: Georges Heinesch | last post by:
An easy ComboBox question. ;) I would like to create a ComboBox, which permits to cycle through 3 subforms. These 3 subforms are entered in the ComboBox as Value List. The subforms should only...
7
by: Nicolae Fieraru | last post by:
Hi All, I am trying to change the rowsource of a combobox when I click on it. I played with many events, associated with the form and the combobox, but still haven't figured out what is the way...
4
by: David Sworder | last post by:
Hi, I have a ComboBox that contains 1,400 sorted items . Here's the list: abba apple ... cabba caccaa capple
4
by: Beeeeeeeeeeeeves | last post by:
I have an ownerdrawn combo box which I am drawing with an image and some text, this is all working beautifully apart from the difference in the Brush I have to draw the background and the text with...
0
by: Hiroyuki Tanaka | last post by:
Hi All, I am trying to develop an application for a touch screen using buttons for the numeric pad with Completion ComboBoxes. At the moment I am having a problem sending the button presses to...
2
by: pei_world | last post by:
I want to implement a key hit with enter to dropdown a combobox that is in the datagrid. in this case I need to override its original behaviours. I found some codes from the web. Does anyone know...
6
by: Sakharam Phapale | last post by:
Hi All, How to fill one ComboBox from other ComboBox control? 1) Only setting the reference does the trick but doesn't show items in control. If you see in immediate window, it shows...
6
by: Hal Heinrich | last post by:
How do I implement the value equivalent of the ComboBox.FindStringExact method? I.e. How do I set the ComboBox.SelectedIndex so that the ComboBox.SelectedValue object matches one that I specify....
4
by: JJGarcia | last post by:
Hi Everyone, I'll try to explain the process I'm following, I'm new to this so I'm triying the easy way first, probably the lasyest too! I created a new Project, drag in to it a SQLConnection,...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.