Combobox object as a command parameter of a button

1 Answer 192 Views
Button ComboBox
Scott
Top achievements
Rank 1
Scott asked on 04 Sep 2023, 02:26 PM

I have a button where I want to navigate to another page with the object of the combobox as the command parameter of the button that the user clicks. How do I reference the object in the command parameter.

 


<telerik:RadComboBox x:Name="arresteeListPicker" ItemsSource="{Binding Arrestees}"
                                           DisplayMemberPath="ArresteeFullName"
                                         Placeholder="Arrestees"
                                         IsEditable="False">
                        
                        <telerik:RadComboBox.ItemTemplate>
                            <DataTemplate x:DataType="model:Arrestee">
                                <Label Text="{Binding ArresteeFullName}"
                                      ></Label>
                            </DataTemplate>
                        </telerik:RadComboBox.ItemTemplate>
                    </telerik:RadComboBox>
                    <Button x:Name="selectArresteeBtn"
                            Text="Select"
                            Command="{Binding SelectArresteeCommand}" 
                            CommandParameter= ?????????
                            WidthRequest="70"
                            HorizontalOptions="Start"
                            Margin="0, 10, 0, 0"
                            />

 

Thank you in advance,

Scott

1 Answer, 1 is accepted

Sort by
0
Didi
Telerik team
answered on 05 Sep 2023, 06:25 AM

Hi Scott,

This question is related to commands in .NET MAUI. More details can be found here: https://learn.microsoft.com/en-us/dotnet/maui/fundamentals/data-binding/commanding. You can also submit your questions to the .NET MAUI forum or StackOverflow.

As you perform navigation and you want to pass data during navigating to a new page, here are mode details how this could be done https://learn.microsoft.com/en-us/dotnet/maui/user-interface/pages/navigationpage#pass-data-during-navigation 

Regards,
Didi
Progress Telerik

A brand new .NET MAUI course was just added to the Virtual Classroom. The training course is developed to help you get started with the Telerik UI for .NET MAUI components and features. It aims to put you in the shoes of an engineer who adds new features to an existing application. You can check it out at https://learn.telerik.com
Tags
Button ComboBox
Asked by
Scott
Top achievements
Rank 1
Answers by
Didi
Telerik team
Share this question
or