Xamarin form - How to customize picket control

1.5k views Asked by At

I am using latest xamarin build 4.5 and trying to apply picker control with following facilities..

  1. Binding option- I could not see ItemsSource property in latest xamarin release. I have used following code to bind picker control in c#

    _pcPicker = this.FindByName("pcPicker");

    foreach (var item in ParentCategory) { _pcPicker.Items.Add(item.Name); }

    I need to bind category id also along with category name...please guide me how to bind and get id of selected category.

I could not follow this link for bindable picker - https://blog.xamarin.com/new-bindable-picker-control-for-xamarin-forms/ ... example given is not complete.

  1. I need add to additional link (Add New category..) at the end of the picker list just as shown in below image.

Please guide me how to customize picker control to achieve these two requirement-

enter image description here

Thanks,

@Paul

1

There are 1 answers

3
Jacob Joz On BEST ANSWER

This nuget package is great and will allow you to achieve what you want.

https://github.com/rotorgames/Rg.Plugins.Popup

It allows you to create a pop up of any type of page. So for your picker, you could create a view that has a StackPanel, that has a ListView (so you can bind your ItemSource) and then 2 buttons New Category, Edit Category.