I want to show Components in a tabs , so first of all create few components. In this project we have three components, First View Component public class AllViewComponent : ViewComponent { private readonly UserManager<ApplicationUser> _userManager; public AllViewComponent(UserManager<ApplicationUser> userManager) { _userManager = userManager; } public async Task<IViewComponentResult> InvokeAsync() { List<StudentViewModel> allUsers = new List<StudentViewModel>(); var items = await _userManager.Users.ToListAsync(); foreach (var item in items) { allUsers.Add(new StudentViewModel {Id=item.Id, EnrollmentNo = item.EnrollmentNo, FatherName = item.FatherName, Name = item.Name, Age = item.Age, Birthdate = item.Birthdate, Address = item.Address, Gender = item.Gender, Email = item.Email }); }
ComboBox in windows forms application -Introduction
A ComboBox display a editable TextBox with ListBox. You can select item from the list also you can search item by using TextBox. The default style of ComboBox is drop-down list. You can change the style of ComboBox with the help of DropDownStyle property. That property contain three enumerated value, If you select Dropdown list box then you can not edit text portion. Now, take a simple example to add items in the Combo Box-please see the video
Video contains different ways to add item in the ComboBox like, using show smart tag, items property, add item at run time using add method.
For adding items at run time in ComboBox:
comboBox1.Items.Add(String text);If you want to change the DropdownStyle at design as well as run time- please see the following video:
I you want to access or retrieve selected item from the comboBox then see this video. In this video i have a comboBox with some fruit items and a button control. When we press the button then selected item show in the messageBox.
Note : If you have to press buton without select any item then get the error message. Video also solve this problem with the help of selectedIndex property. So in this video you will see the example of SelectedIndex property.
Now, come to the DataSource property of comboBox. Bind the combobox with the class and enumeration type. Video contain example of both type.
If you want to add thousand of item without any intrupt then use beginUpdate() and EndUpdate() method of it. This video contain example of both, also contain findString method example.
Comments
Post a Comment