TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Abhilash J A
525
2.4k
600.7k
How to bind combobox in WPF in C#.Net?
Oct 23 2016 2:10 AM
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?
Reply
Answers (
4
)
Focus textbox after async call -
WPF center screen issues