vendredi 17 février 2023

How can I multi-select items in the model using picker in xamarin or otherwise?

xaml.cs page:

public partial class TalimatGorevEkle : ContentPage
    {
        TalimatGorevModelmobil Model;
        
        public TalimatGorevEkle() { 

            InitializeComponent();
            var kullanicilist = Methodlar.GorevliListeGetir(Sabitler.Token);
           
            
            KullaniciSec.ItemsSource = kullanicilist.GorevliListe;  //picker'da listelenecek kişiler

            
        }
    }

.xaml file:

<?xml version="1.0" encoding="UTF-8" ?>
<ContentPage
    xmlns="http://xamarin.com/schemas/2014/forms"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    x:Class="OzelKalem.Views.ListeContentViews.TalimatGorevEkle">
    <ContentPage.Content>
        <ScrollView>
            <StackLayout>
              
               <Grid>
                   <StackLayout  Grid.Row="0" Padding="8">
                       <Label Text="Görev Başlığı:" TextColor="#FF7F24" FontSize="14"></Label>
                       <Entry x:Name="talimatAdi" Placeholder="Görev Başlığı Giriniz" HeightRequest="60" ></Entry>
                       <Label Text="Görev Adı:" TextColor="#FF7F24" FontSize="14" ></Label>
                       <Entry x:Name="talimatGörevAdi" Placeholder="Görev Adı Giriniz" HeightRequest="60" ></Entry>
                       <Label Text= "Görevin Son Tarihini Seçiniz:" TextColor="#FF7F24" FontSize="14"></Label>
                       <DatePicker Format="dd-MM-yyyy HH:mm" x:Name="gorevSonTarih" TextColor="Black" ></DatePicker>
                       <Picker x:Name="KullaniciSec" Title="Kullanıcı seçiniz." ItemsSource="{Binding GorevliListeModel}" ItemDisplayBinding="{Binding GorevliKullaniciAdi}"></Picker>
                       <Button x:Name="SaveCourseButton" Clicked="GorevEkle" Command="{Binding}" Text="Kaydet" BackgroundColor="LightGray" TextColor="#FF7F24" Margin="3" />
                       
                   </StackLayout>


               </Grid>
            </StackLayout>
        </ScrollView>
    </ContentPage.Content>
</ContentPage>

I have a list in xamarin I have it displayed in picker. But I want it to be multiple selectable. How can I write for it? How should I select it as checkbox or over the picker? enter image description here




Aucun commentaire:

Enregistrer un commentaire