Click here to Skip to main content
15,898,373 members
Home / Discussions / C#
   

C#

 
QuestionCombobox problem Pin
Hum Dum10-Jun-10 23:02
Hum Dum10-Jun-10 23:02 
AnswerRe: Combobox problem Pin
ddecoy11-Jun-10 1:15
ddecoy11-Jun-10 1:15 
GeneralRe: Combobox problem Pin
Hum Dum11-Jun-10 1:58
Hum Dum11-Jun-10 1:58 
AnswerRe: Combobox problem Pin
Luc Pattyn11-Jun-10 1:21
sitebuilderLuc Pattyn11-Jun-10 1:21 
GeneralRe: Combobox problem Pin
ddecoy11-Jun-10 1:41
ddecoy11-Jun-10 1:41 
GeneralRe: Combobox problem Pin
Luc Pattyn11-Jun-10 1:59
sitebuilderLuc Pattyn11-Jun-10 1:59 
GeneralRe: Combobox problem Pin
Hum Dum11-Jun-10 2:27
Hum Dum11-Jun-10 2:27 
GeneralRe: Combobox problem [modified] Pin
Luc Pattyn11-Jun-10 2:45
sitebuilderLuc Pattyn11-Jun-10 2:45 
1.
The hint is in the documentation:
"SelectedText gets or sets the text that is selected in the editable portion of a ComboBox".

A ComboBox allows you to choose one item from a list; doing so will fire some events and set some properties, in particular SelectedIndex and SelectedValue. These apply to you point-and-clicking in the list.

It also often allows you to type a text yourself; if so, you can edit the text, select part of it, copy, cut, paste, etc. There SelectedText works like it does in a TextBox. That is unrelated to point-and-clicking in the list.

When you do point and click, the TextBox part will reflect what you have selected, and under some conditions, it will also select it (turning it white on blue), at that time SelectedText would become equal to SelectedValue.

Hence: use SelectedIndex for retrieving the index inside a SelectedIndexChanged handler.

2.

Hum Dum wrote:
foreach (DataTable dt in dsTemp)


does not work when dsTemp is a DataSet. A DataSet holds tables but does not enumerate them automatically.
However
foreach (DataTable dt in dsTemp.Tables)

should work for you.

Smile | :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]

I only read formatted code with indentation, so please use PRE tags for code snippets.

I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).

modified on Friday, June 11, 2010 8:51 AM

GeneralRe: Combobox problem Pin
Hum Dum13-Jun-10 17:41
Hum Dum13-Jun-10 17:41 
GeneralRe: Combobox problem Pin
Luc Pattyn13-Jun-10 18:05
sitebuilderLuc Pattyn13-Jun-10 18:05 
QuestionDisconnect SSL connection after user has logout Pin
tiffanygct10-Jun-10 22:20
tiffanygct10-Jun-10 22:20 
QuestionHow do I find the BITMAPINFOHEADER of a image Pin
TimSWatson10-Jun-10 21:49
TimSWatson10-Jun-10 21:49 
AnswerRe: How do I find the BITMAPINFOHEADER of a image Pin
Henry Minute11-Jun-10 6:11
Henry Minute11-Jun-10 6:11 
GeneralRe: How do I find the BITMAPINFOHEADER of a image Pin
TimSWatson13-Jun-10 21:51
TimSWatson13-Jun-10 21:51 
GeneralRe: How do I find the BITMAPINFOHEADER of a image Pin
Henry Minute14-Jun-10 1:16
Henry Minute14-Jun-10 1:16 
QuestionRandomize from array Pin
Socheat.Net10-Jun-10 21:00
Socheat.Net10-Jun-10 21:00 
AnswerRe: Randomize from array Pin
OriginalGriff10-Jun-10 21:46
mveOriginalGriff10-Jun-10 21:46 
GeneralRe: Randomize from array Pin
Socheat.Net10-Jun-10 22:13
Socheat.Net10-Jun-10 22:13 
GeneralRe: Randomize from array Pin
Socheat.Net11-Jun-10 1:03
Socheat.Net11-Jun-10 1:03 
GeneralRe: Randomize from array Pin
OriginalGriff11-Jun-10 1:19
mveOriginalGriff11-Jun-10 1:19 
GeneralRe: Randomize from array Pin
OriginalGriff11-Jun-10 1:20
mveOriginalGriff11-Jun-10 1:20 
AnswerRe: Randomize from array Pin
Luc Pattyn11-Jun-10 1:44
sitebuilderLuc Pattyn11-Jun-10 1:44 
GeneralRe: Randomize from array Pin
harold aptroot11-Jun-10 1:53
harold aptroot11-Jun-10 1:53 
GeneralRe: Randomize from array Pin
Luc Pattyn11-Jun-10 2:11
sitebuilderLuc Pattyn11-Jun-10 2:11 
GeneralRe: Randomize from array Pin
harold aptroot11-Jun-10 2:44
harold aptroot11-Jun-10 2:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.