Telerik Forums
UI for Xamarin Forum
0 answers
57 views


Hi,

I'm trying to read the value of selectedPoint.DataItem in RadCartesianChartView when selecting the bar. 

DataPoint selectedPoint = e.P0.SelectedDataPoint();
var dataItem = selectedPoint.DataItem;
Casting the dataItem to C# object like
public class CastJavaObject
    {
        public static T Cast<T>(Java.Lang.Object? obj) where T : class
        {
            var propInfo = obj.GetType().GetProperty("Instance");
            return propInfo == null ? null : propInfo.GetValue(obj, null) as T;
        }
    }
and using the CastJavaObject like
var poco = CastJavaObject.Cast<Result>(dataItem);
The problem is Casting the dataItem always null. Any help on reading the dataItem values.

Thanks.
HV
Top achievements
Rank 1
 updated question on 13 Jun 2023
1 answer
71 views

Hi,

I've added 3 different bar series to RadCartesianChartView and added ChartSelectionBehavior like

 RadCartesianChartView chartView = new RadCartesianChartView(this);
 BarSeries barSeries = new BarSeries();
 BarSeries barSeries1 = new BarSeries();
 BarSeries barSeries2 = new BarSeries();

barSeries.CombineMode = ChartSeriesCombineMode.Stack;
barSeries.CategoryBinding = new MonthResultDataBinding("Month");
barSeries.ValueBinding = new MonthResultDataBinding("Result");
barSeries.SelectedFillColor = Color.Green;
barSeries.SelectedStrokeColor = Color.Red;
barSeries.SelectedStrokeWidth = 5;
barSeries.Data = (Java.Lang.IIterable)this.monthResults;
chartView.Series.Add(barSeries);

barSeries1.CombineMode = ChartSeriesCombineMode.Stack;
barSeries1.CategoryBinding = new MonthResultDataBinding("Month");
barSeries1.ValueBinding = new MonthResultDataBinding("Result1");
barSeries1.SelectedFillColor = Color.Blue;
barSeries1.SelectedStrokeColor = Color.Red;
barSeries1.SelectedStrokeWidth = 5;
barSeries1.Data = (Java.Lang.IIterable)this.monthResults;
chartView.Series.Add(barSeries1); barSeries2.CombineMode = ChartSeriesCombineMode.Stack; barSeries2.CategoryBinding = new MonthResultDataBinding("Month"); barSeries2.ValueBinding = new MonthResultDataBinding("Result2"); barSeries2.SelectedFillColor = Color.Orange; barSeries2.SelectedStrokeColor = Color.Red; barSeries2.SelectedStrokeWidth = 5; barSeries2.Data = (Java.Lang.IIterable)this.monthResults; chartView.Series.Add(barSeries2); ChartSelectionBehavior selectionBehavior = new ChartSelectionBehavior(); selectionBehavior.DataPointsSelectionMode = ChartSelectionMode.Single; chartView.Behaviors.Add(selectionBehavior);

While selecting the bar it selects only one barseries value. How can I select the 3 barseries values on single click.

 

Didi
Telerik team
 answered on 07 Jun 2023
0 answers
121 views

Hi,

List view is not rendering on the iphone/Simulator with iOS 16

When i try to load it on ipad with ios14, it was working fine.

I see below errors in output when debugging in VS2022

*** Assertion failure in -[TKCollectionView _Bug_Detected_In_Client_Of_UICollectionView_Invalid_Batch_Updates:], UICollectionView.m:10064
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid batch updates detected: the number of sections and/or items returned by the data source before and/or after performing the batch updates are inconsistent with the updates.

Please advise if this is known issue.

Xamarin Control Version - 2021.1.413.0

iOS SDK - 16.4/15.5

Thank you

Balwinder

Elvin
Top achievements
Rank 1
 asked on 06 Jun 2023
1 answer
55 views

Hi Team,

Could you please help me how to scroll the RadCartesianChartView horizontally in Xamarin.Android.

Thank you! 

Didi
Telerik team
 answered on 30 May 2023
19 answers
1.1K+ views

I keep running into:
Java.Lang.RuntimeException: Font asset not found Fonts/telerikfont.ttf

When trying to access any page with an AutoCompleteView.
I'm not sure why this started happening. This used to work fine and I never had to include any sort of Telerik fonts in my project, nor do I reference any. I tried downloading the font and including it where it wanted (Assets/Fonts/telerikfont.ttf) and it still barks at me as if it doesn't see it.

 

othmane
Top achievements
Rank 1
Iron
 answered on 11 May 2023
0 answers
101 views

Hi, I have an issue with RadListView Pull To Refresh, it doesn't work for iOS after using MyControl. MyControl opens RadPopup.

Down below-written sommelier code, please help to fix the issue.

<Grid VerticalOptions="FillAndExpand" HorizontalOptions ="FillAndExpand" RowSpacing="0" BackgroundColor="Red">
      <Grid.RowDefinitions>
        <RowDefinition Height="{x:Static resource:UiConst.ViewSize45}"/>
        <RowDefinition Height="{x:Static resource:UiConst.ViewSize1}"/>
        <RowDefinition Height="*"/>
      </Grid.RowDefinitions>
      <StackLayout Grid.Row="0" Margin="10, 3, 0, 0" >
              //do something 
      </StackLayout>

      <BoxView Grid.Row="1"  />

 
        <datacontrols:RadListView     x:Name="listview"   BackgroundColor="Azure" Margin="0, 0, 0, 1"
                                    Grid.Row="2" HorizontalOptions = "FillAndExpand" VerticalOptions = "StartAndExpand"
                                    IsItemSwipeEnabled="True" 
                                    ItemSwipeCompleted="OnItemSwipeCompleted"
                                    ItemSwipeStarting ="Listview_ItemSwipeStarting"
                                    ItemsSource="Item"
                                    SelectionMode="None" 
                                    ItemTapped="ItemTapped"
                                    SwipeOffset="75,0,0,0" SwipeThreshold="10" 
                                    RefreshRequested="RadListView_RefreshRequested" 
                                    IsPullToRefreshEnabled="True" IsPullToRefreshActive="false">
          <datacontrols:RadListView.ItemTemplate>
            <DataTemplate>
              <listview:ListViewTemplateCell>
                <listview:ListViewTemplateCell.View>
                  <Grid HorizontalOptions="FillAndExpand" VerticalOptions="Center" Margin="0, 0, 0, -5">
                    <Grid.BackgroundColor>
                      <Binding Path="ReadTimeStamp" Mode="TwoWay">
                        <Binding.Converter>
                          <conv:NullToObjectConverter x:TypeArguments="Color"
                                               NullObject="blue"
                                               NotNullObject="white"/>
                        </Binding.Converter>
                      </Binding>
                    </Grid.BackgroundColor>

                    <Grid.RowDefinitions>
                      <RowDefinition Height="70"/>
                      <RowDefinition Height="1"/>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                      <ColumnDefinition Width="80"/>
                      <ColumnDefinition Width="*"/>
                      <ColumnDefinition Width="80"/>
                    </Grid.ColumnDefinitions>

                    <Frame Grid.Column="0" Grid.Row="0" Margin="10, 5, 10, 0" >

                                <StackLayout>

                        <svg:SvgCachedImage />

                        <Label Text="text"/>
                      </StackLayout>
                    </Frame>

                   
                    <StackLayout Grid.Column="1" Grid.Row="0" Margin="5, 10, 5,  0" >
                      <Label Text=""/>

                      <Label Text=""/>
                    </StackLayout> 

                    <StackLayout Grid.Column="2" Grid.Row="0" Margin="0, 10, 5, 0"  >
                      <Grid   >
                        <Frame >
                                 <svg:SvgCachedImage /> 
                        </Frame>

                        <controls:MyControl"/>
                      </Grid>
                     
                      <Label Text=""/> 
                    </StackLayout>

                    <BoxView Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3"/>
                  </Grid>
                </listview:ListViewTemplateCell.View>
              </listview:ListViewTemplateCell>
            </DataTemplate>
          </datacontrols:RadListView.ItemTemplate>
          <datacontrols:RadListView.ItemSwipeContentTemplate>
            <DataTemplate>
              <Grid Margin="0"
                  Padding="0"
                  ColumnSpacing="0"
                  RowSpacing="0" 
                  BackgroundColor="">
                <Grid.ColumnDefinitions>
                  <ColumnDefinition Width="75"/>
                  <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <StackLayout >
                  <svg:SvgCachedImage 
                     WidthRequest="30" HeightRequest="30"
                     Source="{Binding SwipeIconSource}"/>
                  <Label   Text="">
                </StackLayout>
              </Grid>
            </DataTemplate>
          </datacontrols:RadListView.ItemSwipeContentTemplate>
        </datacontrols:RadListView>
      </Grid>
    </Grid>

                                   
Hakob
Top achievements
Rank 1
 updated question on 07 Apr 2023
1 answer
82 views
how can I give label positions at outside in piechatseries
Didi
Telerik team
 answered on 06 Apr 2023
2 answers
62 views
Can I render my gauge chart ranges from c# code to UI?I have to bind my ranges based on specific conditions. Finally the ranges colors should be given in xaml. How can I achieve this? 
Lance | Manager Technical Support
Telerik team
 answered on 29 Mar 2023
1 answer
61 views
how can I give area border for linechart?
Didi
Telerik team
 answered on 28 Mar 2023
1 answer
60 views
How to hide and show series based on legend clickevent
Didi
Telerik team
 answered on 27 Mar 2023
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
Iron
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?