Telerik Forums
UI for Xamarin Forum
1 answer
207 views

Hi all,

 

 

we have a XAML chart which works fine if data is set in the viewmodel when the page is drawn. If we update the observable collection (itemsource) later, only the x-axis labels are drawn but neither the bars nor the Y-axis is drawn (Xamarin Forms latest version with latests version of Telerik charts)

 

Here is our XAML:

 

      <telerikChart:RadCartesianChart Grid.Row="6" Margin="35,0,10,5" BackgroundColor="Red">
    
        <telerikChart:RadCartesianChart.Palette>      
          <telerikChart:ChartPalette>
              <telerikChart:ChartPalette.Entries>
                  <telerikChart:PaletteEntry FillColor="White" StrokeColor="White"/>
                  <telerikChart:PaletteEntry FillColor="Pink" StrokeColor="Pink" />
              </telerikChart:ChartPalette.Entries>
            </telerikChart:ChartPalette>
        </telerikChart:RadCartesianChart.Palette>  

        <telerikChart:RadCartesianChart.Grid> 
              <telerikChart:CartesianChartGrid StripLinesVisibility="None" YStripeColor="Red" YStripeAlternativeColor="Red" XStripeColor="Red" XStripeAlternativeColor="Red"/>   
        </telerikChart:RadCartesianChart.Grid> 

        <telerikChart:RadCartesianChart.HorizontalAxis>
          <telerikChart:CategoricalAxis LineColor="White" LabelTextColor="White" GapLength="0.7"/>
        </telerikChart:RadCartesianChart.HorizontalAxis>
        <telerikChart:RadCartesianChart.VerticalAxis>
          <telerikChart:NumericalAxis LineColor="Red" LabelTextColor="White"/>
        </telerikChart:RadCartesianChart.VerticalAxis>   
            
        <telerikChart:RadCartesianChart.Series>
          <telerikChart:BarSeries CombineMode="Cluster" ItemsSource="{Binding Revenue, Mode=TwoWay}">
            <telerikChart:BarSeries.ValueBinding>
              <telerikChart:PropertyNameDataPointBinding PropertyName="Value"/>
            </telerikChart:BarSeries.ValueBinding>
            <telerikChart:BarSeries.CategoryBinding>
              <telerikChart:PropertyNameDataPointBinding PropertyName="Category"/>
            </telerikChart:BarSeries.CategoryBinding>
          </telerikChart:BarSeries>
          <telerikChart:BarSeries CombineMode="Cluster" ItemsSource="{Binding Expenditure, Mode=TwoWay}">
            <telerikChart:BarSeries.ValueBinding>
              <telerikChart:PropertyNameDataPointBinding PropertyName="Value"/>
            </telerikChart:BarSeries.ValueBinding>
            <telerikChart:BarSeries.CategoryBinding>
              <telerikChart:PropertyNameDataPointBinding PropertyName="Category"/>
            </telerikChart:BarSeries.CategoryBinding>
          </telerikChart:BarSeries>
        </telerikChart:RadCartesianChart.Series>
              
      </telerikChart:RadCartesianChart>

 

And here is the code which then updates the viewmodel - as said, the labels (Category) on the X-Axis work, but not the values or the Y-Axis:

 

            try {
                List<SumStat> sumStatList = bindableDataPackage.sumStats;
                var revenues = new ObservableCollection<CategoricalData>();
                var expenditures = new ObservableCollection<CategoricalData>();

                foreach (var stat in sumStatList) {
                    if (stat.sumplus < 50000) { 
                        revenues.Add(new CategoricalData { Category = stat.day, Value = stat.sumplus });
                        expenditures.Add(new CategoricalData { Category = stat.day, Value = stat.summinus });
                    }
                }

// these 2 properties of type observable collection trigger the update
                Revenue = revenues;
                Expenditure = expenditures;
                

            } catch (Exception e) {
                StarFinanz.Core.Diagnostics.Trace.TraceInformation("Error: " + e.Message);
            }

Lance | Senior Manager Technical Support
Telerik team
 answered on 25 Jul 2017
1 answer
120 views
 <telerikGauges:RadRadialGauge.Axis>
   <telerikGauges:GaugeLinearAxis Maximum="{Binding Kpi,Converter={StaticResource MaxValueConverter}}" Minimum="0" Step="200" ShowLabels="True" FontSize="15" FontFamily="Calibri" />
</telerikGauges:RadRadialGauge.Axis>

 

Hello there,

I have a problem with Telerik Gauge.

In the above code, I want to do a Binding to the STEP section.

Now I am solving this with binding context changed event, but sometimes I get wrong data. :(

 

I want it to be as follows.

<telerikGauges:RadRadialGauge.Axis>
   <telerikGauges:GaugeLinearAxis Maximum="{Binding Kpi,Converter={StaticResource MaxValueConverter}}" Minimum="0" Step="{Binding Kpi.Value}" ShowLabels="True" FontSize="15" FontFamily="Calibri" />
</telerikGauges:RadRadialGauge.Axis>

 

Docs are very weak. This is really upsetting.

 

Thanks..

Petar Marchev
Telerik team
 answered on 25 Jul 2017
3 answers
493 views

I have a Telerik TabView which has Telerik ListView in one of the tabs.

The first time page with tabs is opened the list view does not show or shows truncated as in the picture below (tab1.png).

When I navigate to another tab and go back to first tab the content is then shown, as seen in the second picture (tab2.png).

<ContentPage.Content>
            <telerikPrimitives:RadTabView x:Name="TabView">
                <telerikPrimitives:RadTabView.Items>
                    <telerikPrimitives:TabViewItem HeaderText="Home">
                        <telerikPrimitives:TabViewItem.Content>
 
                            <telerikDataControls:RadListView x:Name="PeopleListView"
                                                             ItemsSource="{Binding}"
                                                             IsItemSwipeEnabled="True"
                                                             SwipeOffset="150, 0, 0, 0"
                                                             SwipeThreshold="10">
                            <!-- ... -->
                            </telerikDataControls:RadListView>
                             
                        </telerikPrimitives:TabViewItem.Content>
                    </telerikPrimitives:TabViewItem>
                    <telerikPrimitives:TabViewItem HeaderText="Folder">
                        <telerikPrimitives:TabViewItem.Content>
                            <Label Margin="10" Text="This is the content of the Folder tab" />
                        </telerikPrimitives:TabViewItem.Content>
                    </telerikPrimitives:TabViewItem>
                    <telerikPrimitives:TabViewItem HeaderText="View">
                        <telerikPrimitives:TabViewItem.Content>
                            <Label Margin="10" Text="This is the content of the View tab" />
                        </telerikPrimitives:TabViewItem.Content>
                    </telerikPrimitives:TabViewItem>
                </telerikPrimitives:RadTabView.Items>
            </telerikPrimitives:RadTabView>
 
    </ContentPage.Content>
Stefan Nenchev
Telerik team
 answered on 21 Jul 2017
2 answers
119 views

Hi guys, I hope you can help me. I have an annotation on a chart at the value of 100 of a numerical vertical axis. Originally the maximum number allowed by the vertical axis is 200 (so the annotation is in the center of the chart), but I am changing dynamically at runtime if the value of the data goes over that value.

This works perfectly on android, but in iOS the position of the annotaion doesn't change while the whole chart resizes, and instead of moving to the right position, it stays at the center of the chart.

I tried removing the annotation and re adding it after modifying the value but it didn't work.

Is this a known bug? How can I work it around?

Thanks

Stefan Nenchev
Telerik team
 answered on 20 Jul 2017
1 answer
149 views

Hi:

I am trying to set the DataTemplate in the xaml under the Resources without luck. It throws a native error.

Do you have a sample about how to define the itemplate using Xaml.

I was using this link without luck:

https://developer.xamarin.com/guides/xamarin-forms/application-fundamentals/templates/data-templates/selector/

 

Thanks in advance.

David

 

 

Stefan Nenchev
Telerik team
 answered on 19 Jul 2017
2 answers
235 views
 Why I need  to include NSCalendarsUsageDescription into my info.plist file to upload the app to appstore even I'm not accessing users calendar
Deepak
Top achievements
Rank 1
 answered on 19 Jul 2017
4 answers
217 views

I created simple Xamarin.Forms app with calendar:

    <StackLayout VerticalOptions="Center">
        <telerikInput:RadCalendar SelectedDate="{Binding SelectedDate, Mode=TwoWay}" />
        <Label FontSize="35" Text="{Binding SelectedDate}" />
    </StackLayout>

so, from 10/29/2017 I got incorrect selected date, for example when I click on 30 October  SelectedDate equals 29 Octovber, on 1 November  SelectedDate = 31  Octovber.....

 

Here is code of page and ViewModel

public partial class MainPage : ContentPage
    {
        public MainPage()
        {
            InitializeComponent();
            BindingContext = new MainPageViewModel();
        }
    }

    public class MainPageViewModel : INotifyPropertyChanged
    {
        private DateTime _selectedDate;

        public DateTime SelectedDate
        {
            get { return _selectedDate; }
            set
            {
                _selectedDate = value;
                OnPropertyChanged();
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;

        [NotifyPropertyChangedInvocator]
        protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }

        public MainPageViewModel()
        {
            SelectedDate = DateTime.Now;
        }
    }

 

p.s. Problem is only in iOS

Georgi
Telerik team
 answered on 18 Jul 2017
1 answer
310 views

My listview cannot show all items.

Below is the code and screenshot. Any ideas?

ScreenShots : https://image.ibb.co/jojuxv/Screenshot_1500002846.png

You can see that is a item not fully shown, i am sure i scrolled to bottom.

 
 
<StackLayout Orientation="Vertical" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
          <telerikInput:RadSegmentedControl x:Name="segmentControl" HorizontalOptions="FillAndExpand" HeightRequest="40" VerticalOptions="Start" SelectionChanged="segmentControl_SelectionChanged"/>
          <StackLayout x:Name="DatePickerView" Orientation="Vertical" HorizontalOptions="FillAndExpand" Margin="10,0,10,2">
              <StackLayout Orientation="Horizontal">
                  <Label Text="{language:TranslateExtension Text=From_str}" VerticalTextAlignment="Center" FontSize="Medium" HorizontalTextAlignment="Start"/>
                  <DatePicker x:Name="FromDatePicker" HorizontalOptions="FillAndExpand" VerticalOptions="Center" />
              </StackLayout>
              <StackLayout Orientation="Horizontal">
                  <Label Text="{language:TranslateExtension Text=To_str}" VerticalTextAlignment="Center" FontSize="Medium" />
                  <DatePicker x:Name="ToDatePicker" HorizontalOptions="FillAndExpand" VerticalOptions="Center" />
              </StackLayout>
              <Button x:Name="FilterButton" Margin="10,0,10,0" Text="{language:TranslateExtension Text=Filter_str}" Clicked="FilterButton_Clicked"
                      HorizontalOptions="FillAndExpand" />
          </StackLayout>
 
          <Label x:Name="ExpandDatePickerIconLabel" FontFamily="FontAwesome" TextColor="{StaticResource Key=AppThemeColor}" FontSize="Small" HorizontalOptions="FillAndExpand" HorizontalTextAlignment="Center" VerticalTextAlignment="Center" Grid.Column="1">
              <Label.GestureRecognizers>
                  <TapGestureRecognizer Tapped="ExpandDatePickerViewTapGestureRecognizer_Tapped"/>
              </Label.GestureRecognizers>
          </Label>
 
          <!--<ActivityIndicator x:Name="LoadingIndicator" HorizontalOptions="CenterAndExpand" VerticalOptions="CenterAndExpand" IsRunning="True" IsVisible="True"/>-->
          <telerikDataControls:RadListView x:Name="OrderList" Margin="5" ItemTapped="OrderList_ItemTapped" LoadOnDemandMode="Automatic" LoadOnDemandBufferItemsCount="10"
                                   ItemsSource="{Binding Source, Mode=TwoWay}" IsVisible="True" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
              <telerikDataControls:RadListView.ItemStyle>
                  <telerikListView:ListViewItemStyle BackgroundColor="Transparent" BorderLocation="Bottom" BorderColor="LightGray" BorderWidth="1"/>
              </telerikDataControls:RadListView.ItemStyle>
              <telerikDataControls:RadListView.SortDescriptors>
                  <telerikListView:PropertySortDescriptor PropertyName="TradeDateTime" SortOrder="Descending"/>
              </telerikDataControls:RadListView.SortDescriptors>
              <telerikDataControls:RadListView.ItemTemplate>
                  <DataTemplate>
                      <telerikListView:ListViewTemplateCell>
                          <telerikListView:ListViewTemplateCell.View>
                              <Grid >
                                  <Grid.ColumnDefinitions>
                                      <ColumnDefinition/>
                                      <ColumnDefinition/>
                                  </Grid.ColumnDefinitions>
                                  <StackLayout Orientation="Vertical" Grid.Column="0" Margin="5">
                                      <Label x:Name="CreationTimeLabel" FontSize="Small" TextColor="DimGray" Text="{Binding Path=orderRecord.OrderTimeInDateTime}"/>
                                      <Grid Margin="10,0,0,0" RowSpacing="2">
                                          <Grid.RowDefinitions>
                                              <RowDefinition/>
                                              <RowDefinition/>
                                              <RowDefinition/>
                                              <RowDefinition/>
                                              <RowDefinition/>
                                          </Grid.RowDefinitions>
                                          <Grid.ColumnDefinitions>
                                              <ColumnDefinition Width="*"/>
                                              <ColumnDefinition Width="2*"/>
                                          </Grid.ColumnDefinitions>
 
                                          <Label x:Name="BuySellLabel" Text="{Binding Path=orderRecord.BuySell, Converter={convertor:BuySellStringConvertor}}" TextColor="{Binding Path=orderRecord.BuySell, Converter={convertor:BuySellColorConvertor}}" FontSize="Large" Grid.Row="0" Grid.Column="0"/>
                                          <Label x:Name="QuantityLabel" Text="{Binding Path=orderRecord.Quantity, Converter={convertor:OrderQuantityConvertor}}" Grid.Row="0" Grid.Column="1" VerticalTextAlignment="Center" VerticalOptions="CenterAndExpand"/>
 
                                          <Label x:Name="StockSymbolLabel" Text="{Binding Path=orderRecord.Symbol}" Grid.Row="1" Grid.Column="0"/>
                                          <Label x:Name="StockNameLabel" Text="{Binding Path=stock.StockName}" Grid.Row="1" Grid.Column="1"/>
 
                                          <Label x:Name="CurrencyLabel" Text="{Binding Path=stock.Currency}" Grid.Row="2" Grid.Column="0"/>
                                          <Label x:Name="PriceLabel" Text="{Binding Path=orderRecord.Price , Converter={convertor:PriceConvertor}}" Grid.Row="2" Grid.Column="1"/>
 
                                          <Label x:Name="InstructLabel" Text="{Binding Path=orderRecord.OrderType, Converter={convertor:OrderInstructStringConvertor}}" Grid.Row="3" Grid.ColumnSpan="2"/>
 
                                          <Label x:Name="EffectiveToLabel" Text="有效至" Grid.Row="4" Grid.Column="0"/>
                                          <Label x:Name="EffectiveToDateLabel" Text="07-10-2017" Grid.Row="4" Grid.Column="1"/>
 
                                      </Grid>
 
                                  </StackLayout>
                                  <StackLayout Orientation="Vertical" Grid.Column="1" Margin="5">
                                      <Label x:Name="OrderRefNumberLabel" HorizontalOptions="End" Text="{Binding Path=orderRecord.OrderNo}" HorizontalTextAlignment="End"/>
                                      <Frame x:Name="OrderStatusFrame" HorizontalOptions="FillAndExpand" OutlineColor="Black" VerticalOptions="Start">
                                          <StackLayout Orientation="Vertical" HorizontalOptions="FillAndExpand">
                                              <Label x:Name="OrderDealStatusLabel" FontSize="Large" TextColor="{Binding Path=orderRecord.OrderStatus,Converter={convertor:OrderStatusColorConvertor}}"
                                                     Text="{Binding Path=orderRecord.OrderStatus, Converter={convertor:OrderStatusStringConvertor}}" HorizontalTextAlignment="Center"/>
                                              <Label x:Name="OrderQuantityStatusLabel" Text="{Binding Path=OrderQuantityStatus}" HorizontalTextAlignment="Center" HorizontalOptions="FillAndExpand"/>
                                              <Label x:Name="OrderTriggerPriceLabel" Text="成交價 : 46.600" HorizontalTextAlignment="Center" HorizontalOptions="FillAndExpand"/>
                                          </StackLayout>
                                      </Frame>
                                      <StackLayout Orientation="Horizontal" HorizontalOptions="Center" IsVisible="{Binding Path=orderRecord.OrderStatus , Converter={convertor:OrderModificationVisibilityConvertor}}">
                                          <Button x:Name="ModifyOrderButton" Text="{language:TranslateExtension Text=Modify_str}" WidthRequest="80" Clicked="ModifyOrderButton_Clicked"/>
                                          <Button x:Name="CancelOrderButton" Text="{language:TranslateExtension Text=Cancel_str}" WidthRequest="80" Clicked="CancelOrderButton_Clicked"/>
                                      </StackLayout>
                                  </StackLayout>
                              </Grid>
 
 
                          </telerikListView:ListViewTemplateCell.View>
                      </telerikListView:ListViewTemplateCell>
                  </DataTemplate>
              </telerikDataControls:RadListView.ItemTemplate>
          </telerikDataControls:RadListView>
      </StackLayout>
Stefan Nenchev
Telerik team
 answered on 18 Jul 2017
1 answer
116 views

Hi,
I've been working with a trial version for Xamarin Forms Telerik Controls. 

Android and UWP works great. When i try to debug on ipad device I get the following error

 

SeverityCodeDescriptionProjectFileLineSuppression State
ErrorFailed to resolve "Telerik.XamarinForms.Common.iOS.IosRendererBase`2" reference from "Telerik.XamarinForms.Common, Version=2017.2.626.234, Culture=neutral, PublicKeyToken=null" C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets747

 

 

Lance | Senior Manager Technical Support
Telerik team
 answered on 17 Jul 2017
2 answers
119 views

I need to have a language select drop down on a data form so I used a language enum as one of the properties on the view model. The drop-down works fine on UWP but throws an exception when rendering on Android. It works fine on Android if I change the field type to string instead of enum. Here is the view model:

public class AppConfiguration
    {
    [DisplayOptions(Header = "API URL")]
    public string ApiUrl { get; set; }
 
    [DisplayOptions(Header = "Preferred Culture")]
    [Ignore]
    public string Culture { get; set; }
 
    public enum LanguageChoices { English, French };
 
    //[DisplayOptions(Header = "Preferred Language")]
    //public string LanguageChoice
    //  {
    //  get
    //      {
    //      if(string.IsNullOrEmpty(Culture))
    //          Culture="en-CA";
    //      switch(Culture.Substring(0, 2).ToLower())
    //          {
    //      case "en":
    //          return "English";
    //      case "fr":
    //          return "French";
    //      default:
    //          return "English";
    //          }
    //      }
    //  set
    //      {
    //      switch(value.Substring(0, 2).ToLower())
    //          {
    //      case "fr":
    //          Culture="fr-CA";
    //          break;
    //      case "en":
    //          Culture="en-CA";
    //          break;
    //      default:
    //          Culture="en-CA";
    //          break;
    //          }
    //      }
    //  }
 
    [DisplayOptions(Header = "Preferred Language")]
    public LanguageChoices LanguageChoice
        {
        get
            {
            if(string.IsNullOrEmpty(Culture))
                Culture="en-CA";
            switch(Culture.Substring(0, 2).ToLower())
                {
            case "en":
                return LanguageChoices.English;
            case "fr":
                return LanguageChoices.French;
            default:
                return LanguageChoices.English;
                }
            }
        set
            {
            switch(value)
                {
            case LanguageChoices.French:
                Culture="fr-CA";
                break;
            case LanguageChoices.English:
                Culture="en-CA";
                break;
            default:
                Culture="en-CA";
                break;
                }
            }
        }
    }
Stefan Nenchev
Telerik team
 answered on 17 Jul 2017
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?