Completed
Last Updated: 03 Jun 2019 14:35 by ADMIN
Release 2019.2.603.360 (R2 2019 minor release)
Created by: Jayd
Comments: 1
Category: Checkbox
Type: Bug Report
9

Hi

 

I have a radcheckbox whose checked value is set on my view model, it is bound oneway. My View model implements INotify. 

When my viewmodel updates the property, the ui does not update. If i set the mode to TwoWay the ui reflects accordingly. I have a converter linked to this same property on another object hence I can't set TwoWay Binding to achieve this(Not included in the sample). The checkbox will just be displaying a state and never be updated by the user

 

I have tested on iOS and UWP. Have not verified on Android currently, but will require this in future.

Attached is a sample project.

Completed
Last Updated: 31 Jan 2019 15:51 by ADMIN
Created by: Jayd
Comments: 1
Category: Checkbox
Type: Bug Report
8
If the checkbox is in the ItemTemplate of the ListView and in runtime the ItemsSource of the ListView is changed, the Checkbox stops updating its UI.
Completed
Last Updated: 19 Jun 2019 12:48 by ADMIN
Release R2 2019 SP1
As the name of the event suggests, it should be raised after IsChecked is changed.
Declined
Last Updated: 02 Mar 2019 06:46 by Alejandro Genovesi

Hello!

When include a CheckBox inside a simple ListView (also with RadListView), and try implement the CheckBoxUserCommand Id="IsCheckedChanged" the control appears disabled.

I use MVVM and I need binding the checkedChanged Command to execute a custom operation related to specific row of the ListView; but, how can i know which element of the ListView affecting when checked  / unchecked the CheckBox. Here the code:

PD: Then prefix name of  <checkBoxComamnds:CheckBoxUserCommand>  is wrong, should be <checkBoxCommands: > (Error in word: Comamnds...)

XAML

<AbsoluteLayout BindingContext ="{Binding ViewModel}">      
        <ListView IsRefreshing="{Binding IsRefreshing, Mode=TwoWay}"
                ItemsSource="{Binding CalendarList}">
                <ListView.ItemTemplate>
                    <DataTemplate>
                       <ViewCell>
                            <Grid>
                                <Grid.RowDefinitions >
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width = "Auto" />
                                    <ColumnDefinition Width="*" />
                                </Grid.ColumnDefinitions >
                                 < !--Calendar checkBox Selector -->
                                <telerikPrimitives:RadCheckBox
                                      x:Name="checkViewCalendar">
                                    <telerikPrimitives:RadCheckBox.Commands>
                                        <checkBoxComamnds:CheckBoxUserCommand
                                              Command = "{Binding IsCheckedChangedCommand}"
                                              Id="IsCheckedChanged" 
                                              SuppressDefaultCommand="True">
                                        </checkBoxComamnds:CheckBoxUserCommand>
                                    </telerikPrimitives:RadCheckBox.Commands>
                                </telerikPrimitives:RadCheckBox>
                                <!-- Name of Agenda -->
                                <Label
                                    Grid.Row="0"
                                    Grid.Column="1"
                                    HorizontalOptions="FillAndExpand"
                                    Text="{Binding Name}">
                                </Label>
                           </Grid >
                      </ViewCell >
                   </DataTemplate >
               </ListView.ItemTemplate >
           </ListView >
</AbsoluteLayout>

MVVM Code


namespace ViewModels
{
   //using ...
    using System.Windows.Input;
    using Xamarin.Forms;
    using Telerik.XamarinForms.Primitives.CheckBox.Commands;

    public class CalendarsViewModel : BaseViewModel
        
       public CalendarsViewModel()
        {
            this.IsCheckedChangedCommand = new Command<CheckBoxIsCheckChangedCommandContext>(this.CheckBoxChange);
            this.LoadCalendars();
        }

       private async void CheckBoxChange(CheckBoxIsCheckChangedCommandContext context)
        {
            await Application.Current.MainPage.DisplayAlert(
                    "MVVM Alert Start",
                    $"CheckBox User Command executed at {DateTime.Now.ToLocalTime()} in {context.ToString()}",
                    "Ok");
           //How identify the container row in the context?
        }
        public ICommand IsCheckedChangedCommand { get; set; }

        public ObservableCollection<Calendar> CalendarList
        {
            get { return this.calendars; }
            set { SetValue(ref this.calendars, value); }
        }
        private async void LoadCalendars()
        {
           // API Call to get List and create ObservableCollection Binding to ListView
        }
Thanks for your help!

Completed
Last Updated: 31 Jan 2019 15:42 by ADMIN