Telerik Forums
UI for Xamarin Forum
2 answers
120 views

As shown in the attached image, I would like to add some customizations to the appointment in the schedule component of the Calendar (what shows up in Day/Week view)

Ideally i'd like to add something like a contentview or viewcell with whatever I like in there? Is this possible. If not what options do I have?

Akin
Top achievements
Rank 1
 answered on 18 Dec 2018
9 answers
203 views

I am trying to set the ItemSource for a chart in a Task method, like this:

Task ShowData() 
{
  return Task.Factory.StartNew(() => {
    // do calculations here...
    LineSeries1.ItemsSource = _chartLines;
  }
}

However, when run, I get the following exception: Unhandled Exception: Java.Util.ConcurrentModificationException

When I change this to a normal void method it works fine. Any pointers as to how to fix this?

My Telerik.Xamarin.Android.Chart dll is v4.0.30319.

Lance | Senior Manager Technical Support
Telerik team
 answered on 14 Dec 2018
2 answers
1.5K+ views

Hi,

I have a datagrid which has an "Actions" column containing two actions(Edit and Delete) bound to radbuttons. I'm wondering how to get the row data when I click either of these 2 buttons.

XAML:

<telerikGrid:DataGridTemplateColumn HeaderText="Actions">
                                        <telerikGrid:DataGridTemplateColumn.CellContentTemplate>
                                            <DataTemplate>
                                                <StackLayout>
                                                    <Grid BackgroundColor="Transparent">
                                                        <Grid.RowDefinitions>
                                                            <RowDefinition Height="Auto" />
                                                        </Grid.RowDefinitions>
                                                        <Grid.ColumnDefinitions>
                                                            <ColumnDefinition Width="Auto" />
                                                            <ColumnDefinition Width="Auto" />
                                                        </Grid.ColumnDefinitions>
                                                        <telerikInput:RadButton 
                                                            Grid.Row="0" Grid.Column="0" HeightRequest="40" Text="Edit" Margin="0, 2, 0, 0" 
                                                            VerticalOptions="StartAndExpand" HorizontalOptions="Center" 
                                                            BackgroundColor="CornflowerBlue" TextColor="White" Clicked="editRow"/>
                                                        <telerikInput:RadButton 
                                                            Grid.Row="0" Grid.Column="1" HeightRequest="40" Text="Delete" Margin="0, 2, 0, 0" 
                                                            VerticalOptions="StartAndExpand" HorizontalOptions="Center" 
                                                            BackgroundColor="Red" TextColor="White" Clicked="deleteRow"/>
                                                    </Grid>
                                                </StackLayout>
                                            </DataTemplate>
                                        </telerikGrid:DataGridTemplateColumn.CellContentTemplate>
                                    </telerikGrid:DataGridTemplateColumn>

 

C#

private void editRow(object sender, EventArgs e)
        {
           //implementing logic based on which row's button is clicked 
        }

        private void deleteRow(object sender, EventArgs e)
        {
            //implementing logic based on which row's button is clicked
        }

Tayfun
Top achievements
Rank 1
 answered on 13 Dec 2018
6 answers
217 views

 

Hello every Teleriker :)

Does anyone managed to set the ViewMode on a RadCalendar on Android with a custom renderer that get the good ViewMode value ?

I set the ViewMode when the RadCalendar NativeControlLoaded event is triggered.

((RadCalendar)sender).TrySetViewMode(CalendarViewMode.Week);

In the code behind of my page, the ViewMode seems to bet set.
But in the CalendarCustomRenderer, e.NewElement.ViewMode always return Month (I'm expecting a Week value).

I would like to add it's working great on iOS (I can cast the Control.Presenter to a TKCalendarWeekPresenter without error).

I've created this custom render because I want to hide the title of the calendar in ViewMode Week.
(again, it's working as expected on iOS).

Is it a known issue (if it is so, should I create a ticket for that ?) or am I missing something ?

I have attached a screenshot of my breackpoint with the wrong value.

I wish a good day to everyone who red this post.

Olivier
Top achievements
Rank 1
 answered on 13 Dec 2018
3 answers
257 views
Another, hopefully, quick question: is there a way to programatically scroll to the last row. Basically, when a new row is added I need to make sure it is visible on screen.
Yana
Telerik team
 answered on 13 Dec 2018
2 answers
170 views

i am using "ListViewTemplateCell" for my item template, i need to have rounded border around selected listview item

<telerikDataControls:RadListView.SelectedItemStyle>
                                    <telerikListView:ListViewItemStyle BackgroundColor="Gray"      
                                                               BorderColor="Green" BorderWidth="4"
                                                               BorderLocation="All"/>
                                </telerikDataControls:RadListView.SelectedItemStyle>

 

1) how to do it ? 

2) can renderers do it ?

i need answer for both iOS and android

Shalin
Top achievements
Rank 1
Iron
Iron
 answered on 13 Dec 2018
1 answer
159 views

A RadCheckbox with IsEnabled="false" is not visible on UWP Xamarin forms app:

<telerikPrimitives:RadCheckBox HorizontalOptions="StartAndExpand" IsEnabled="false" IsChecked="{Binding Exam.OpticianExamComplete}"  Grid.Row="0" Grid.Column="2" VerticalOptions="Center"  />


Yana
Telerik team
 answered on 13 Dec 2018
1 answer
1.4K+ views

Hi, I have a problem when using BusyIndicator. I mark the following error when I want to change its status to false

 

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation

 

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:telerikInput="clr-namespace:Telerik.XamarinForms.Input;assembly=Telerik.XamarinForms.Input"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:local="clr-namespace:ONControl_Mobile.CUST.VinculoCultural"
             xmlns:telerikInputDataForm="clr-namespace:Telerik.XamarinForms.Input.DataForm;assembly=Telerik.XamarinForms.Input"
             xmlns:telerikPrimitives="clr-namespace:Telerik.XamarinForms.Primitives;assembly=Telerik.XamarinForms.Primitives"
             x:Class="ONControl_Mobile.CUST.VinculoCultural.VCPA_AutorizacionContratoDetail"
             BackgroundColor="White">
    <telerikPrimitives:RadBusyIndicator x:Name="BusyIndicator"
                                        AnimationContentHeightRequest="150"
                                        AnimationContentWidthRequest="150"  
                                        AnimationType="Animation3"
                                        AnimationContentColor="#4E6F99">

        <telerikPrimitives:RadBusyIndicator.BusyContent>
            <Label Text="Cargando..."  HorizontalOptions="Center" HorizontalTextAlignment="Center"/>
        </telerikPrimitives:RadBusyIndicator.BusyContent>
        <telerikPrimitives:RadBusyIndicator.Content>

            <ScrollView>
                <AbsoluteLayout  HorizontalOptions="FillAndExpand"  BackgroundColor="White">
                        <StackLayout Padding="5,5,5,10">
                    <!--<ScrollView>-->
                        <Grid VerticalOptions="Start">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="18" />
                                <RowDefinition Height="40" />
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="5*" />
                                <ColumnDefinition Width="5*" />
                            </Grid.ColumnDefinitions>


                            <Label x:Name="LB_Folio"  Text="Folio:" Grid.Row="0" Grid.Column="0"  HorizontalOptions="FillAndExpand" Font="12" TextColor="Black" FontAttributes="Bold" Margin="5,0,0,0"/>
                            <Label x:Name="LB_Fecha" Text="Fecha:" Grid.Row="0" Grid.Column="1" HorizontalOptions="End" Font="12" TextColor="Black" FontAttributes="Bold" Margin="0,0,5,0"/>

                            <telerikInput:RadEntry x:Name="TB_ClienteDescripcion"
                                                   TextColor="Black"
                                                   FontSize="19"
                                                   Text="Cliente"
                                                   Grid.Row="1" 
                                                   Grid.Column="0" 
                                                   Grid.ColumnSpan="2"
                                                   HorizontalOptions="FillAndExpand"
                                                   VerticalTextAlignment="Center"
                                                   Opacity="70"
                                                   BorderStyle="{StaticResource EntryBorderStyle}"
                                                   IsEnabled="False"/>
                        </Grid>

                        <!-- Se pinta Dataform-->
                        <telerikInput:RadDataForm x:Name="RDF_Contrato" 
                                              Margin="5,5,0,0"    
                                              ValidationMode="Manual">
                            <telerikInput:RadDataForm.Source>
                                <local:VCPA_ContratoSource />
                            </telerikInput:RadDataForm.Source>
                            <telerikInput:RadDataForm.GroupHeaderStyle>
                                <telerikInputDataForm:DataFormGroupHeaderStyle Background="Gainsboro" Foreground="Black" Height="55" Padding="10" TextAlignment="Center" />
                            </telerikInput:RadDataForm.GroupHeaderStyle>
                        </telerikInput:RadDataForm>

                        <!--Spinner-->
                        <Label Text="Seleccionar Estado" FontSize="12" TextColor="#424242" FontAttributes="Bold" Font="Arial"></Label>
                        <Picker x:Name="P_Estado"
                                Grid.Row="2" 
                                Grid.Column="0"  
                                Grid.ColumnSpan="2"  
                                HorizontalOptions="FillAndExpand"
                                FontSize="Small" 
                                VerticalOptions="Start" 
                                TextColor="Gainsboro" 
                                SelectedIndexChanged="P_Estado_SelectedIndexChanged"/>

                        <Label Text="Seleccionar Ciudad" FontSize="12" TextColor="#424242" FontAttributes="Bold" Font="Arial"></Label>
                        <Picker x:Name="P_Ciudad"
                                Grid.Row="3" 
                                Grid.Column="0"  
                                Grid.ColumnSpan="2"  
                                HorizontalOptions="FillAndExpand" 
                                FontSize="Small" 
                                VerticalOptions="Start" 
                                TextColor="Gainsboro" 
                                SelectedIndexChanged="P_Ciudad_SelectedIndexChanged"/>

                        <!--Grabar Documento-->
                        <telerikInput:RadButton x:Name="B_Autorizar" 
                                                Text="Autorizar Contrato" 
                                                Clicked="B_Autorizar_Clicked" 
                                                FontSize="12" 
                                                TextColor="Black"/>

                        <!--</ScrollView>-->
                    </StackLayout>
                </AbsoluteLayout>
            </ScrollView>
        </telerikPrimitives:RadBusyIndicator.Content>
    </telerikPrimitives:RadBusyIndicator>   
</ContentPage>

Lance | Senior Manager Technical Support
Telerik team
 answered on 12 Dec 2018
2 answers
193 views
Hello,

I'm using RadDataGrid component in my project and I have some questions that I do not find the answers neither on the forum or on the net.

Is it possible to override the sorting event in the goal to sort on our data source ? My use case is the following : I display a list in my RadDataGrid, when the user scrolls, the data loads with the load on demand. That's working like a charm ! But when he presses the header, the displayed data are sorted. What we want is to sort on all the dataset not only the displayed. So, is there a way to override the clic on the header or a workaround to do this ?

I got a second question, is it possible to include a footer in a RadDataGrid ? A fixed component like the headers but on the bottom of the RadDataGrid. The use case is the following : I got a RadDataGrid with 10-20 rows which contain numbers, I want a line highlighted as the one of the headers with the total of each columns of the RadDataGrid and which stay on the bottom even during a sort. Is that possible ?

I tried to put a Grid under the RadDataGrid but I can't get column's ActualWidth property, it's always set to 0. Like the SizeMode of my columns is not Fixed I can't use the Width property. Here how I try to get the width of a column when the RadDataGrid is displayed :
radDataGrid.Columns[0].ActualWidth


Thanks a lot for the time you spent to read this, I hope you can help me.
Raphael
Top achievements
Rank 1
 answered on 10 Dec 2018
1 answer
191 views

I am facing an issue regarding Xamarin Telerik RadCartesianChart, While zooming with setting the GapLength="0.9" MajorTickInterval="30",
No new labels created or rendered to the chart as predicted, it works normally for android but on iOS it does nothing just zooming without rendering the hidden labels as happened at the Android platform,
Kindly advice if there are any other attribute should be set to make this functionality work

ViewModel Code

01.using System.Collections.ObjectModel;
02.using System.Windows.Input;
03.using Prism.Navigation;
04.using Xamarin.Forms;
05. 
06.namespace Demo.ViewModels
07.{
08.    public class CategoricalData
09.    {
10.        public object Category { get; set; }
11. 
12.        public double Value { get; set; }
13.    }
14.    public class ChartPageViewModel : BaseViewModel
15.    {
16.        private ObservableCollection<CategoricalData> _data;
17. 
18.        public ObservableCollection<CategoricalData> Data
19.        {
20.            get => _data;
21.            set
22.            {
23.                //_data = value;
24.                SetProperty(ref _data, value);
25.                RaisePropertyChanged(nameof(Data));
26.            }
27.        }
28.        public ChartPageViewModel()
29.        {
30.            LoadDummyData();
31.        }
32. 
33.        public void LoadDummyData()
34.        {
35.           var dData = new ObservableCollection<CategoricalData>();
36.            for (int i = 0; i < 300; i++)
37.            {
38.                dData.Add(new CategoricalData { Category = i, Value = (i%10 > 0)?( (i%2>0)? (i%30):(i%20)): 5 });
39.            }
40. 
41.            Data = dData;
42.        }
43. 
44. 
45.    }
46.}

 

Xaml Code

01.<?xml version="1.0" encoding="utf-8" ?>
03.             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
04.             xmlns:prism="clr-namespace:Prism.Mvvm;assembly=Prism.Forms"
05.             xmlns:chart="clr-namespace:Telerik.XamarinForms.Chart;assembly=Telerik.XamarinForms.Chart"
06.             prism:ViewModelLocator.AutowireViewModel="True" BackgroundColor="{StaticResource BackgroundColor}"
07.             x:Class="Demo.Views.ChartPage">
08. 
09. 
10.            <chart:RadCartesianChart x:Name="chart" BackgroundColor="Transparent" Grid.Row="1" >
11.                <chart:RadCartesianChart.ChartBehaviors>
12.                    <chart:ChartPanAndZoomBehavior ZoomMode="Horizontal" PanMode="Horizontal" />
13.                </chart:RadCartesianChart.ChartBehaviors>
14.                <chart:RadCartesianChart.HorizontalAxis >
15.                    <OnPlatform x:TypeArguments="chart:CartesianAxis">
16.                        <On Platform="Android">
17.                            <chart:CategoricalAxis LineColor="#A9A9A9" MajorTickThickness="2" PlotMode="BetweenTicks" LabelFitMode="None"
18.                                                   MajorTickBackgroundColor="#A9A9A9" GapLength="0.9" MajorTickInterval="50" LabelTextColor="White" ShowLabels="True"/>
19.                        </On>
20.                        <On Platform="iOS">
21.                            <chart:CategoricalAxis LineColor="#A9A9A9" MajorTickThickness="2" PlotMode="BetweenTicks" LabelFitMode="None"
22.                                                   MajorTickBackgroundColor="#A9A9A9" GapLength="0.9" MajorTickInterval="30"  LabelTextColor="White" ShowLabels="True" />
23.                        </On>
24.                    </OnPlatform>
25.                </chart:RadCartesianChart.HorizontalAxis>
26.                <chart:RadCartesianChart.VerticalAxis>
27.                    <chart:NumericalAxis LabelTextColor="White" ShowLabels="True" Minimum="0" Maximum="80" LineColor="#A9A9A9" MajorTickBackgroundColor="#A9A9A9" />
28.                </chart:RadCartesianChart.VerticalAxis>
29.                <chart:RadCartesianChart.Series>
30.                    <chart:LineSeries CategoryBinding="Category" ValueBinding="Value" ItemsSource="{Binding Data}" />
31.                </chart:RadCartesianChart.Series>
32.                <chart:RadCartesianChart.Grid>
33.                    <chart:CartesianChartGrid MajorLinesVisibility="XY" MajorLineThickness="1"/>
34.                </chart:RadCartesianChart.Grid>
35. 
36.            </chart:RadCartesianChart>
37.         
38.</ContentPage>

 

Development Environment:

  • iOS 12.1
  • Xamarin Forms 3.2

Yana
Telerik team
 answered on 06 Dec 2018
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?