Posted 1 February 2021, 6:18 pm EST
Is there a built-in option/example for adding a combo box type column? I would like to add one limited to the list and one where they can also type if selection is not present.
Forums Home / ComponentOne / ComponentOne Studio for Xamarin
Posted by: chris on 1 February 2021, 6:18 pm EST
Posted 1 February 2021, 6:18 pm EST
Is there a built-in option/example for adding a combo box type column? I would like to add one limited to the list and one where they can also type if selection is not present.
Posted 2 February 2021, 4:52 am EST
Hi Chris
You can add a combobox type column in the C1 Xamarin flexGrid. FlexGrid Column provides you an option of DataMap property which shows you the list of items set as the ItemSource DataMap of the flexgrid column
grid.Columns["CountryID"].DataMap = new GridDataMap() { ItemsSource = Customer.GetCountries(), DisplayMemberPath = "Value", SelectedValuePath = "Key" };
For reference please have a look at the attached video, also you can refer to the ColumnDefinitions sample of the FlexGrid101 sample, which you can find at the below location
“Documents\ComponentOne Samples\Xamarin\CS\XF”
Please let me know if you need any other help.
Thanks
Posted 2 February 2021, 2:30 pm EST
Thanks, is there any better documentation available? The current documentation just looks like it was autgenerated and simply states what it is, for example the DataMap Itemsource just states syntax. Where can i find out what the fields are for? itemsource wants a key value pair if int,string but what is the int for? The string I assume will be what is displayed, is int just a counter? and what is displaymemberpath? I think selectedvaluepath will show the selected item highlighted when dropping down?
Posted 2 February 2021, 4:04 pm EST
I don’t see a way to allow a user to type in a value if the needed item is in the drop down list, is this possible?
Posted 3 February 2021, 10:21 am EST
Hi Chris
Please have a look at the below documentation, which explains the SeletedValuePath and DisplayMemberPath.
https://www.grapecity.com/componentone/docs/xamarin/online-forms/DataMapping.html
Please let me know if you need any other help.
Thanks
Posted 3 February 2021, 2:47 pm EST
OK, thanks, I was looking at some other documentation.
I still need to know if there is an option to have a dropdown list and allow typing.
Posted 4 February 2021, 3:13 pm EST
I still need to know if there is an option to have a dropdown list and allow typing.
Posted 4 February 2021, 5:48 pm EST
Hi Chris
We can only see the values in the dropdown of any cell using the DataMap property. Currently, DataMap does not allow typing/editing of values similar to that of Combobox.
Please let me know if you need any other help.
Thanks