Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ComboData
- {
- public int Id { get; set;}
- public string Value { get; set;}
- public string description { get; set;}
- }
- List<ComboData> ListData = new List<ComboData>();
- ListData.Add(new ComboData { Id = "1", Value = "One" });
- ListData.Add(new ComboData { Id = "2", Value = "Two" });
- ListData.Add(new ComboData { Id = "3", Value = "Three" });
- ListData.Add(new ComboData { Id = "4", Value = "Four" });
- ListData.Add(new ComboData { Id = "5", Value = "Five" });
- cbotest.ItemsSource = ListData;
- cbotest.DisplayMemberPath = "Value";
- cbotest.SelectedValuePath = "Id";
- cbotest.SelectedValue = "2";
- public class DAL
- {
- Dbcontext db = new Dbcontext();
- public List<ComboData> GetAll()
- {
- var sp = db.ComboDatas.ToList();
- return sp;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement