Telerik Forums
UI for Xamarin Forum
1 answer
174 views

Hello, I have a  Button (Next) and a RadDataGrid  in Page1 which shows the data received from a Web service. Now, I when I select any Item and click next, the data inside the grid completely disappears (or clears) before going to Page 2. 

Now, the same scenario doesn't happen when I click Next and no Item is selected. 

I'm receiving the data correctly in both cases, but I can't seem to figure out why the grid is cleared before navigating to Page2. 

I used a simple Navigation.PushAsync to go to Page 2. 

Could you please help me out here?

Didi
Telerik team
 answered on 15 Jul 2020
3 answers
598 views

for simplicity i have simplified this as much as possible.

 

I have a rad list with a number of different custom ListViewTemplateCell.View s one includes a custom version of the rad picker. I have created a bindable property (callled test below) which fires the first time the control is created but never fires after the bound value is updated (called AField for simplicity). I am calling OnPropertyChanged  for this field from the rows binding which I can confirm is working

 

if i take this all and put it into another custom control (based on radentry) on the same row it is working fine. Is this something that can be achieved with the picker control or will it not pick up properties changed like this?

////////////////////

 

 

                                <controls:DSRadPicker Grid.Column="0" Grid.Row="1" Test ="{Binding  AField, Mode=OneWay}"  DSSelectionChanged="DSRadPicker_SelectionChanged" />

 

public partial class DSRadPicker : RadListPicker 
    {

 public static readonly BindableProperty DSBindingProperty = BindableProperty.Create( 
             nameof(DSBinding),
             typeof(DSFormPickerListLine2),
             typeof(DSRadPicker),
             defaultValue: null,
             defaultBindingMode: BindingMode.TwoWay,
            propertyChanged: BindingPropertyChanged
        );

        public static readonly BindableProperty TestProperty =
               BindableProperty.CreateAttached(
                    nameof(Test),
             typeof(string),
             typeof(DSRadPicker),
                   "",
                   BindingMode.TwoWay,
                   null,
                   propertyChanged: HandleTextChanged);


        public string Test
        {
            get { return (string)GetValue(TestProperty); }
            set { SetValue(TestProperty, value); }
        }

        static void HandleTextChanged(BindableObject bindable, object oldValue, object newValue)
        {
            
        }

}

Didi
Telerik team
 answered on 15 Jul 2020
2 answers
635 views

Hi,

I've only just begun evaluating Telerik for Xamarin Forms over Syncfusion and I've immediately ran into an issue with the ListView. I'm using a DataTemplateSelector for the item template of the list and it's throwing an exception:

System.InvalidOperationException: LoadTemplate should not be null
   at Xamarin.Forms.ElementTemplate.CreateContent()
   at Telerik.XamarinForms.DataControlsRenderer.UWP.ExtendedListViewItem.UpdateTemplate(RadListView listView, Object dataItem)
   at Telerik.XamarinForms.DataControlsRenderer.UWP.UWPListView.PrepareContainerForItem(RadListViewItem item, Object context)
   at Telerik.UI.Xaml.Controls.Data.ListView.View.Controls.ListViewItemUIContainerGenerator.PrepareContainerForItem(GeneratedItemModel el

This is the list view in xaml:

<telerikDataControls:RadListView ItemsSource="{Binding Mappings.Items}"
                                     ItemTemplate="{StaticResource CaseTemplateSelector}"
                                     BackgroundColor="{x:Static resources:Colours.PageBackground}"
                                     ItemTapped="CaseListItemTapped"
                                     IsItemsReorderEnabled="True"
                                     ReorderStarting="ReorderStarting"
                                     ReorderEnded="ReorderEnded"
                                     SelectionMode="None"
                                     VerticalScrollBarVisibility="Never"
                                     Grid.Column="0"
                                     Grid.Row="1"/>

The template selector is added to static resources via the application resources container in App.xaml along with the DataTemplates that are returned from the OnSelectTemplate method. The OnSelectTemplate method always returns a value, or it throws an exception, a breakpoint on this method does not get hit before the exception fires.

Are there any special measures required for RadListView to use DataTemplateSelector? Switching back to the Xamarin Forms ListView works fine on all platforms (once I remove the Reorder properties in the xaml) and I haven't found anything in the documentation for this being a known issue. Is there something I'm missing or is this just not possible with RadListView?

Thanks,

Lance | Senior Manager Technical Support
Telerik team
 answered on 08 Jul 2020
2 answers
142 views

Hi,

I'm working on an application using the Telerik Calendar for Xamarin Forms. I have a ContentPage where I show both a month view calendar, and below that, a agenda view calendar. The user can change language in the settings for this application, and therefore I need to be able to change the language for the calendars accordingly. I've implemented custom renderers for this, both for iOS and Android. For Android, the agenda view calendar is not updated (the language does not change), but it works for the calendar with month view. In iOS, this all works fine when setting Locale on the TKCalendar. On Android, I'm setting Locale on the RadCalendarView control.

 

Is the localization for agenda view not working like this for Android? Is there any other properties that needs to be changed? I've attached one images from Android where I changed language from english to swedish. This works on iOS, but the agenda view calendar on Android is still in english.

I would be really thankful for any help!

 

Yana
Telerik team
 answered on 08 Jul 2020
3 answers
363 views

we supported Android, iOS, and UWP with Xamarin forms, on the UWP platform we are using a RadListView to display a long list of items.  When a user presses on that item it pushes a new Detail page using MasterDetailContentNavigationPage, which all works fine

When exiting the detail page back down the stack to the page with the RadListView it does not maintain the position within the list. It seems like it reloads all the songs within the list and attempts to scroll to the previous position but doesn't hit the correct point

When using a normal ListView from xamarin forms this behavior does not exist

 

Wondering what might be going on or if i need a renderer or something

 

Thanks for any advice

Brenden

Yana
Telerik team
 answered on 06 Jul 2020
4 answers
227 views

Hi,

I am trying to create the equivalent of a header template in the RadListView by using grouping with a single group.

The problem is that the group header template is invoked twice instead of once, resulting in 2 headers displayed on top of each other with a slight offset. Am I doing something wrong or is this a bug in RadListView?

Here are my relevant code snippets:

list.GroupHeaderTemplate = new DataTemplate(() => {
    return new Label { HorizontalTextAlignment = TextAlignment.Center, Text = "Welcome to Xamarin Forms!" }; // This is invoked twice instead of once
});

list.GroupDescriptors.Add(new PropertyGroupDescriptor { PropertyName = nameof(TestItem.GroupKey) });

Where the ItemsSource is a List<TestItem> with 50 items and the TestItem class is defined as:

    class TestItem
    {
        static object groupKey = new object();
        public object GroupKey { get { return groupKey; } }
    }


Yana
Telerik team
 answered on 06 Jul 2020
2 answers
144 views

Good Day 

i have a control template define like the one below . Inside the ControlTemplate  there is ChatEntry control named "txtchatmessage" and a TextChanged event handler named txtchatmessage_TextChanged and Focus , when i enter text this even does not get fired 

 

<p> private void Txtchatmessage_TextChanged(object sender, TextChangedEventArgs e)<br>
        {<br>
          //my logic<br>
         }</p> <p></p>

 

  <ControlTemplate x:Key="CustomChatControlTemplate"><br>
                <Grid telerikInput:KeyboardHelper.IsTranslationTarget="True" <br>
              RowSpacing="2"> <br>
                    <Grid.RowDefinitions><br>
                        <RowDefinition /><br>
                        <RowDefinition Height="Auto" /><br>
                        <RowDefinition Height="Auto" /><br>
                    </Grid.RowDefinitions><br>
                    <Image HorizontalOptions="FillAndExpand" x:Name="ctr1" VerticalOptions="FillAndExpand" Aspect="AspectFill" Source="chat_background.png"   /> <br>
<br>
                    <Grid Grid.Row="2"  Padding="5, 0, 0, 0"><br>
                        <Grid.ColumnDefinitions> <br>
                            <ColumnDefinition Width="Auto" /><br>
                            <ColumnDefinition Width="Auto" /><br>
                        </Grid.ColumnDefinitions><br>
<br>
                        <StackLayout Orientation="Vertical"   BackgroundColor="White" ><br>
                             <StackLayout  Orientation="Horizontal"  BackgroundColor="Transparent"> <br>
                                <telerikConversationalUI:ChatEntry       x:Name="txtchatmessage"  Keyboard="Chat"  TextChanged="txtchatmessage_TextChanged"  <br>
                    HorizontalOptions="StartAndExpand" WidthRequest="280"     <br>
                    telerikInput:KeyboardHelper.IsTranslationSource="True" /><br>
<br>
                                     <StackLayout Orientation="Horizontal"><br>
                                    <Button x:Name="btnattach"  <br>
                                        ImageSource="attach_final.png"<br>
                                        BackgroundColor="Transparent" <br>
                                        WidthRequest="30" <br>
                                                Clicked="btnattach_Clicked"<br>
                                        HeightRequest="30"<br>
                                        VerticalOptions="Center" /><br>
 <br>
                            <Button <br>
                                        ImageSource="send_final.png" <br>
                                        BackgroundColor="Transparent" <br>
                                        Clicked="chat_send"<br>
                                        x:Name="btnsend"  <br>
                                        WidthRequest="30"<br>
                                        HeightRequest="30"<br>
                                        VerticalOptions="Center" /><br>
                                </StackLayout> <br>
                            <br>
                        </StackLayout><br>
                        </StackLayout><br>
                    </Grid><br>
                </Grid><br>
            </ControlTemplate>

 

this controlTemplate is defined in 

  <VisualElement.Resources>     
     <ResourceDictionary>

and used in the chat control like this 

         <telerikConversationalUI:RadChat x:Name="chat"  Grid.Row="1"  <br>                                    AutoScrollMode="Automatic"   SendMessageButtonImage="" ControlTemplate="{StaticResource RadChat_ControlTemplate}">
Vuyiswa
Top achievements
Rank 2
 answered on 30 Jun 2020
3 answers
432 views

Good Day 

i have managed to customize the radchat and now i am using control template .  and in the control tamplate i have an ChatEntry for some reason the textchanged event and focus event dont get fired. 

 

            <ControlTemplate x:Key="RadChat_ControlTemplate"><br>                <Grid telerikInput:KeyboardHelper.IsTranslationTarget="True"<br>            RowSpacing="2"><br>                    <Grid.RowDefinitions><br>                        <RowDefinition /><br>                        <RowDefinition Height="Auto" /><br>                        <RowDefinition Height="Auto" /><br>                    </Grid.RowDefinitions><br>                    <Image HorizontalOptions="FillAndExpand" x:Name="ctr1" VerticalOptions="FillAndExpand" Aspect="AspectFill" Source="chat_background.png"   /><br><br>                    <telerikConversationalUI:ChatListView telerikCommon:StyleManager.InheritedStyleClass="{TemplateBinding ActualStyleClass}"<br>                                                AutoScrollMode="{TemplateBinding AutoScrollMode}"<br>                                                ScrollMediator="{TemplateBinding ActualScrollMediator}"<br>                                                Margin="{Binding Height, Source={x:Reference PickerContainer}, Converter={StaticResource ChatListViewMarginConverter}}"<br>                                                ItemTemplate="{TemplateBinding ItemTemplateSelector}" <br>                                                ItemsSource="{TemplateBinding Items}"<br>                                                AutomationProperties.Name="ChatListView" /><br>                    <telerikCommon:RadContentView telerikCommon:StyleManager.InheritedStyleClass="{TemplateBinding ActualStyleClass}"<br>                                        Grid.Row="1"<br>                                        Content="{TemplateBinding TypingIndicator}" /><br>                    <telerikCommon:RadContentView telerikCommon:StyleManager.InheritedStyleClass="{TemplateBinding ActualStyleClass}"<br>                                        x:Name="PickerContainer"<br>                                        VerticalOptions="End"<br>                                        Content="{TemplateBinding Picker}" /><br>                    <Grid Grid.Row="2" BackgroundColor="{TemplateBinding InputAreaBackgroundColor}" Padding="5, 0, 0, 0"><br>                        <Grid.ColumnDefinitions><br>                            <ColumnDefinition /><br>                            <ColumnDefinition Width="Auto" /><br>                        </Grid.ColumnDefinitions><br>                        <StackLayout Orientation="Horizontal" HorizontalOptions="StartAndExpand"><br>                            <telerikConversationalUI:ChatEntry telerikCommon:StyleManager.InheritedStyleClass="{TemplateBinding ActualStyleClass}"<br>                                                Text="{TemplateBinding Message, Mode=TwoWay}"<br>                                                BackgroundColor="Transparent"  WidthRequest="270"<br>                                                VerticalOptions="Center" Keyboard="Chat"<br>                                                CompletedCommand="{TemplateBinding ActualSendMessageCommand}"<br>                                                FocusMediator="{TemplateBinding FocusMediator}"<br>                                                telerikInput:KeyboardHelper.IsTranslationSource="True" /><br>             <br>                            <telerikInput:RadButton x:Name="btnattach"  <br>                                        ImageSource="attach_final.png"<br>                                      <br>                                                Clicked="btnattach_Clicked"<br>                                telerikCommon:StyleManager.InheritedStyleClass="{TemplateBinding ActualStyleClass}"<br>                                        Grid.Column="1"<br>                                        Margin="0, 0, 10, 0"<br>                                        BackgroundImage="{TemplateBinding SendMessageButtonImage}"<br>                                        BackgroundColor="Transparent" <br>                                        WidthRequest="30"<br>                                        HeightRequest="30"<br>                                        VerticalOptions="Center"<br>                                       /><br><br>                            <telerikInput:RadButton x:Name="btnsend"  <br>                                        ImageSource="send_final.png" <br>                                telerikCommon:StyleManager.InheritedStyleClass="{TemplateBinding ActualStyleClass}"<br>                                        Grid.Column="1"<br>                                        Margin="0, 0, 10, 0" <br>                                        BackgroundImage="{TemplateBinding SendMessageButtonImage}"<br>                                        BackgroundColor="Transparent" <br>                                        WidthRequest="30"<br>                                        HeightRequest="30"<br>                                        VerticalOptions="Center"<br>                                   Clicked="chat_send"<br>                                       /><br>                        </StackLayout><br>                    </Grid><br>                </Grid><br>            </ControlTemplate>

 

<p>private void Txtchatmessage_TextChanged(object sender, TextChangedEventArgs e)<br>        {</p><p>}</p>
Lance | Senior Manager Technical Support
Telerik team
 answered on 29 Jun 2020
8 answers
282 views

Hello

 

I want to use Accordion UI element on my project. I've used the sample code but I have a problem. Instead of the expand arrows, I see the Chinese characters. It seems very weird. I've added an expander and it works fine.

On the attached picture, you will see the expander on the top, and accordion on the bottom. I made blue circle for expander and red circle for accordion.

My core library is .Net Standard 2.0. Maybe it can be the reason. Could you check the problem?

PS: I've tried both with phone and the emulator.

Didi
Telerik team
 answered on 29 Jun 2020
4 answers
318 views

How can I specify the order in which groups are displayed in the RadListView? The control is automatically sorting my groups alphabetically (regardless of the order in which my items of a specific group are added to my collection), which I really don't want. In fact, my goal is to always have the groups in a specific order that cannot be re-ordered, and I want to specify this order explicitly. That is, it's not an ascending or descending order, but an arbitrary one that I specify.

Here's my XAML:

<telerikDataControls:RadListView x:Name="listView" ItemsSource="{Binding Path=Items}" ItemTemplateSelector="{StaticResource Key=itemDataSelector}" GroupHeaderTemplate="{StaticResource Key=headersTemplate}">
    <telerikDataControls:RadListView.GroupDescriptors>
        <telerikListView:PropertyGroupDescriptor PropertyName="Name"/>
    </telerikDataControls:RadListView.GroupDescriptors>
    <telerikDataControls:RadListView.HeaderTemplate>
        <DataTemplate>
            <Label Text="..."
                    FontSize="Title"
                    FontAttributes="Bold"
                    HorizontalOptions="Fill"
                    HorizontalTextAlignment="Center" />
        </DataTemplate>
    </telerikDataControls:RadListView.HeaderTemplate>
    <telerikDataControls:RadListView.FooterTemplate>
        <DataTemplate>
            <Label Text="..."                       
                    HorizontalOptions="Fill"
                    HorizontalTextAlignment="Center"/>
        </DataTemplate>
    </telerikDataControls:RadListView.FooterTemplate>
</telerikDataControls:RadListView>

 

I'm using Telerik UI for Xamarin 2020.1.218.1, Xamarin Forms 4.5.0.530.

Paul Ridden
Top achievements
Rank 1
Veteran
 answered on 26 Jun 2020
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?