|
-
May 14th, 2004, 10:14 AM
#1
Thread Starter
Fanatic Member
databinding to combo
how do you get a combo box to show a selected index compared to the value store in the database via databinding.....
my binding code
VB Code:
Me.cboIndexPeriod.DataBindings.Add(New System.Windows.Forms.Binding("Text", MyDataSource, "Table.SpiderPeriod"))
contain int value i have a combo displaying values from table a
0, Weekly
1, monthly
i wana display the text value depending on the value in my dataset. this int value is the fk to the table that displays in the combo
hope this makes sense
I am curretly building a defect management system for software and web developers,
If you wana try it out (beta test) and keep it for free just send me a message
-
May 14th, 2004, 12:03 PM
#2
Thread Starter
Fanatic Member
I am curretly building a defect management system for software and web developers,
If you wana try it out (beta test) and keep it for free just send me a message
-
May 16th, 2004, 02:59 AM
#3
Thread Starter
Fanatic Member
I am curretly building a defect management system for software and web developers,
If you wana try it out (beta test) and keep it for free just send me a message
-
May 16th, 2004, 04:23 AM
#4
Thread Starter
Fanatic Member
Let me rephase my queston
How do you display a combo box depending on its data member, IE i have a form which navigates records in my dataset.
the values in a certain column can be anything 0 to 4
my combo box is populated with
weekly
fortnightly
monthly
quaterly
yearly
my databinding will return a number and then i want to use index of to display the correct period, how is this done ?
I am curretly building a defect management system for software and web developers,
If you wana try it out (beta test) and keep it for free just send me a message
-
May 16th, 2004, 05:59 AM
#5
Frenzied Member
Sorry, I still don't get what you're trying to do. You say you've got the number 0 - 4, and the selecteditem from the combobox. Are you trying to associate the number with the selecteditem? get the selectedindex of the selecteditem? Not sure what you want.
-
May 16th, 2004, 01:31 PM
#6
Wouldn't it be easier to just inner join in your query that you are using for the datasource. That would allow you to bind the display and value to the two fields in your source. Otherwise you have to set a relationship in the dataset after loading it and fidget about with that whole thing.
-
May 16th, 2004, 03:12 PM
#7
Thread Starter
Fanatic Member
I like your thinking Edneeis
Sorry having bit of a DOH weekend, too much sun, (for once)
I am curretly building a defect management system for software and web developers,
If you wana try it out (beta test) and keep it for free just send me a message
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|