C1ComboBox Problems getting Value

Posted by: sbuescher on 6 September 2021, 2:28 pm EST

  • Posted 6 September 2021, 2:28 pm EST

    Hi,

    maybe i am only brick in front of my head but it didn’t work as expected.

    I have a C1ComboBox in my Xamarin Forms App:

    Declared in the Xaml :

    
    <c1:C1ComboBox x:Name="combComments" Margin="10,0,10,0" 
                           Text="{Binding CombCommentText}"                           
                           IsEditable="True"                        
                           VerticalOptions="Start"  
                           DropDownWidth="250"                       
                           DropDownMode="ForceAbove"
                           IsVisible="{Binding CombCommentVisible}">
                    <c1:C1ComboBox.ItemsSource>
                        <x:Array Type="{x:Type x:String}">
                            <x:String>No Outbound (see Load)</x:String>
                            <x:String>Cont. steht am W11</x:String>
                            <x:String>No Outbound - Weps</x:String>
                            <x:String>Overflow to (see Load)</x:String>
                            <x:String>INB Freight West</x:String>
                            <x:String>Others:</x:String>
                        </x:Array>
                    </c1:C1ComboBox.ItemsSource>
                    <c1:C1ComboBox.Behaviors>
                        <b:EventToCommandBehavior EventName="SelectedIndexChanged" Command="{Binding CombUldInfoSelectedIndexChangedCommand}"
                                              CommandParameter="{Binding Source={x:Reference combComments}, Path=Text}" />
                    </c1:C1ComboBox.Behaviors>
    
    

    In my Page View model i have the Property as follows:

    
            public string CombCommentText
            {
                get { return _combCommentText; }
                set
                {
                    if (value == _combCommentText)
                        return;
    
                    SetProperty(ref _combCommentText, value);
                }
            }
    
    

    But when i want to read the actual value displayed in the combobox i only get an empty string back.

    Can you help me what is wrong there.

    Rgds

    Sascha

  • Posted 7 September 2021, 12:07 am EST

    Hi Sascha

    Thanks for reaching out to us.

    I am not able to execute the code snippet provided by you. Can you please share a small sample replicating the issue? that will help us to assist you better.

    Please let me know if you need any other help.

    Thanks

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels