New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Help Needed...ComboBox #57
Comments
Bind items or items source I think in combobox to some collection in your code. Add items to this collection. Haven't used it but something like that perhaps. You have list of properties in docs https://mdc-maui.github.io/combo-box. If you by any chance don't know what binding is learn that first and how mvvm works |
Will update soon |
Seems to be binding for Tried to do it by editing the sample project from |
Copy! |
yes.. did all that.. and still couldnt... can wait... why not... |
I am able to add items to combobox from code behind file. But You will Have to Make Observable Collection of Material.Components.Maui.MenuItem. And you will have to Add to the Items Property in combobox. For eg there are 2 ways : foreach(var item in myCollection)
Use Linq. var cmbItemsCollection = new ObservableCollection<Material.Components.Maui.MenuItem>(mycollection.Select(p=> new Material.Components.Maui.MenuItem() { Text = p.PropertyName }).ToList()); //Now add the observable collection in the Combobox items : combobox1.Items.AddRange<Material.Components.Maui.MenuItem>(cmbItemsCollection); Adding items is done , but When there are many items, there is no scrollbar coming. Thank you, |
Hi..
How to add items to Combobox in Codebehind..
TIA
The text was updated successfully, but these errors were encountered: