Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
4
Reply
How to bind combobox in WPF in C#.Net?
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
Mani Kandan
7y
331
1
Reply
Hello everyone,
I have arraylist users.
How can I add combobox Zeroth position defult text?
<
ComboBox
ItemsSource
=
"{Binding UserName}"
Name
=
"cmbUserName"
Height
=
"30"
VerticalAlignment
=
"Top"
Margin
=
"10,64,614,0"
/>
var logList = service.GetLogDetails();
var UserName = (from A
in
logList orderby A.FirstName select
new
UserName { Users = A.FirstName +
" "
+ A.SurName, ID = Convert.ToInt32(A.Id) }).Distinct();
cmbUserName.Text =
"Username"
; /*
How can I add combobox Zeroth position text?
*/
cmbUserName.ItemsSource = UserName;
I want to add these usernames in Combobox and set ID. Then, pass ID where combobox on change. How can I do this?
Post
Reset
Cancel
Answers (
4
)
Next Recommended Forum
Focus textbox after async call -
WPF center screen issues