Hello everyone,
I have arraylist users.
- <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?


Amit GuptaRank #190 · 12.8K reputationPosted Oct 23, 2016, 2:04 AM EDT
Praveen Gopal101 reputationPosted Nov 17, 2016, 1:43 AM EST
Abhilash J ARank #1,243 · 1.4K reputationPosted Oct 23, 2016, 3:13 AM EDT
Amit GuptaRank #190 · 12.8K reputationPosted Oct 23, 2016, 4:51 AM EDT