Hi, I am Implementing the Bar series, I am able to draw the Bars, But I need to apply different colors to each bar. I've tried like below but no use.
ChartPalette customPalette = chartView.Palette.ClonePalette();
PaletteEntry barEntry = customPalette.GetEntry(ChartPalette.BarFamily);
barEntry = customPalette.GetEntry(ChartPalette.BarFamily);
barEntry.Fill = Color.Black;
PaletteEntry barEntry1 = customPalette.GetEntry(ChartPalette.BarFamily);
barEntry1= customPalette.GetEntry(ChartPalette.BarFamily);
barEntry1.Fill = Color.Red;
PaletteEntry barEntry2 = customPalette.GetEntry(ChartPalette.BarFamily);
barEntry2 = customPalette.GetEntry(ChartPalette.BarFamily);
barEntry2 .Fill = Color.Yellow;
barSeries.CategoryBinding = new MonthResultDataBinding("Index");
barSeries.ValueBinding = new MonthResultDataBinding("BarValue");
barSeries.Data = (Java.Lang.IIterable)this.monthResults;
chartView.Series.Add(barSeries);
chartView.Palette = customPalette;
Any help on adding different color for each data point.
Hello,
I am encountering an issue with the RadBorder control in Xamarin.Forms on iOS devices. The RadBorder control is not rendering correctly, and its properties such as Margin and CornerRadius are not being applied on iOS. I have tested the code on Android devices, where it functions as expected.
Here is a snippet of the XAML code that demonstrates the issue:
<telerikDataControls:RadListView x:Name="TaskList"
Grid.Row="1"
IsItemSwipeEnabled="True"
ItemSwipeCompleted="TaskList_ItemSwipeCompleted"
SelectionChanged="TaskList_SelectionChanged"
SelectionMode="Single"
SelectionGesture="Tap"
SwipeOffset="50, 0, 50, 0"
SwipeThreshold="10"
HeightRequest="30"
RefreshRequested="TaskList_RefreshRequested"
IsPullToRefreshActive="True"
IsPullToRefreshEnabled="True"
VerticalOptions="FillAndExpand"
BackgroundColor="LightGray" >
<telerikDataControls:RadListView.ItemTemplate >
<DataTemplate>
<telerikListView:ListViewTemplateCell >
<telerikListView:ListViewTemplateCell.View>
<Grid >
<telerikPrimitives:RadBorder BorderColor="#268ecd" Margin="3,6" BorderThickness="0" CornerRadius="18" >
<StackLayout Orientation="Horizontal"
Style="{StaticResource ListItem}"
VerticalOptions="FillAndExpand"
Padding="0"
BackgroundColor="White">
<BoxView BackgroundColor="{Binding CriticalityColors}" WidthRequest="7" HeightRequest="10" HorizontalOptions="Start"/>
<StackLayout Orientation="Vertical" HorizontalOptions="FillAndExpand" Spacing="0" Padding="0, 15">
<StackLayout Orientation="Vertical" HorizontalOptions="StartAndExpand" Spacing="5">
<Label Text="{Binding TaskLabel}" Style="{StaticResource ListHeader}" TextColor="{StaticResource LightBlueColor}" />
<Label Text="{Binding TargetLabel}" Style="{StaticResource ListInfo}" TextColor="{StaticResource GreyColor}" />
</StackLayout>
<StackLayout Orientation="Horizontal" HorizontalOptions="FillAndExpand" Spacing="5">
<Label Text="{Binding CategoryDesc}" Style="{StaticResource ListInfo}" IsVisible="True" TextColor="{StaticResource GreyColor}" Padding="0, 5" HorizontalOptions="StartAndExpand"/>
<Label x:Name="DesComplLbl" Text="{Binding DesComplDateParenthesis}" Style="{StaticResource ListInfo}" IsVisible="False" BindingContextChanged="DesComplLbl_BindingContextChanged" HorizontalOptions="End" Padding="0, 5"/>
</StackLayout>
</StackLayout>
<Image x:Name="statusImg" HorizontalOptions="End" Source="{Binding StatusImage}" Margin="0,0,0,10"/>
</StackLayout>
</telerikPrimitives:RadBorder>
</Grid>
</telerikListView:ListViewTemplateCell.View>
</telerikListView:ListViewTemplateCell>
</DataTemplate>
</telerikDataControls:RadListView.ItemTemplate>
<telerikDataControls:RadListView.ItemSwipeContentTemplate>
I have also provided below the Expected Output (Android) and the Incorrect Output (iOS)
Also there is an other issue for the IOS that when i Load the List for the first time the spacing behaves irregularly but after i refresh it the spacing returns to normal
The RadSideDrawer Drawer content is not fully visible for Android Low resolution devices. With the below same code for iOS there is not problem for any resolutions. And correct layout & incorrect layout snapshot also attached for the issue. Please help on this.
<Grid AbsoluteLayout.LayoutFlags="All" AbsoluteLayout.LayoutBounds="0,0,1,1" Margin="0,0,0,0" Grid.Row="1">
<telerikPrimitives:RadSideDrawer x:Name="drawer" HeightRequest="{Binding DisplayHeight}"
DrawerLocation="Bottom"
DrawerTransitionType="SlideInOnTop"
AreGesturesEnabled="True"
BackgroundColor="Transparent"
DrawerClosing="drawerClose" >
<!--telerikPrimitives:RadSideDrawer.HeightRequest>
<OnPlatform x:TypeArguments="Thickness"
iOS="16,6"
Android="16,0,16,30">
</OnPlatform>
</-->
<telerikPrimitives:RadSideDrawer.MainContent AbsoluteLayout.LayoutFlags="All" AbsoluteLayout.LayoutBounds="0,0,1,1">
<Grid BackgroundColor="Transparent">
<Grid.Margin>
<OnPlatform x:TypeArguments="Thickness"
iOS="16,0,16,73"
Android="16,0,16,75">
</OnPlatform>
</Grid.Margin>
<telerikDataControls:RadListView x:Name="listView" ItemTapped="ListView_ItemTapped"
ItemsSource="{Binding UserDevices, Mode=TwoWay}" NativeControlLoaded="RadListView_NativeControlLoaded"
NativeControlUnloaded="RadListView_NativeControlUnloaded" BackgroundColor="Transparent"
ItemTemplate="{StaticResource ListViewItemTemplate}"
IsLoadOnDemandEnabled="True" LoadOnDemandMode="Automatic"
GroupHeaderTemplate="{StaticResource ListViewGroupHeaderTemplate}"
GroupHeaderStyle="{StaticResource ListViewGroupHeaderStyle}">
<telerikDataControls:RadListView.GroupDescriptors>
<telerikListView:PropertyGroupDescriptor PropertyName="CategoryText" SortOrder="Ascending"/>
</telerikDataControls:RadListView.GroupDescriptors>
<telerikDataControls:RadListView.LayoutDefinition>
<telerikListView:ListViewGridLayout HorizontalItemSpacing="7" SpanCount="2" VerticalItemSpacing="7" ItemLength="104"/>
</telerikDataControls:RadListView.LayoutDefinition>
<telerikDataControls:RadListView.SelectedItemStyle>
<telerikListView:ListViewItemStyle BackgroundColor="#FFE8E8E8"
BorderColor="#FFFFFFFF" />
</telerikDataControls:RadListView.SelectedItemStyle>
</telerikDataControls:RadListView>
<telerikPrimitives:RadBusyIndicator x:Name="BusyIndicator"
AnimationContentHeightRequest="100"
AnimationContentWidthRequest="100"
AnimationType="Animation9"
InputTransparent="{Binding IsNotBusy}"
AnimationContentColor="DarkSlateGray"
IsBusy="{Binding IsBusy}" >
<controls:RadBusyIndicator.Animations>
<common:RadDoubleAnimation Easing="Linear"
PropertyPath="Rotation"
RepeatForever="True"
Target="{Reference Name=image}"
From="0"
To="360" />
</controls:RadBusyIndicator.Animations>
<controls:RadBusyIndicator.BusyContent>
<Image x:Name="image"
HeightRequest="200"
HorizontalOptions="Center"
VerticalOptions="Center"
WidthRequest="200">
</Image>
</controls:RadBusyIndicator.BusyContent>
</telerikPrimitives:RadBusyIndicator>
</Grid>
</telerikPrimitives:RadSideDrawer.MainContent>
<telerikPrimitives:RadSideDrawer.DrawerContent AbsoluteLayout.LayoutFlags="All" AbsoluteLayout.LayoutBounds="0,0,1,1">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="60"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.Margin>
<OnPlatform x:TypeArguments="Thickness"
Android="0,0,0,28">
<!--iOS="0,0,0,40"-->
</OnPlatform>
</Grid.Margin>
<StackLayout Orientation="Horizontal" BackgroundColor="#EDECE8" HorizontalOptions="FillAndExpand" Grid.Row="0"
VerticalOptions="CenterAndExpand" Opacity="0.9" Focused="drawerClose" IsTabStop="False">
<StackLayout HorizontalOptions="StartAndExpand" Orientation="Horizontal" >
<ImageButton x:Name="deviceIcon" Source="Blind_1.png" VerticalOptions="Center" HorizontalOptions="Center" Margin="10,10,0,10" HeightRequest="40" WidthRequest="40" Clicked="EditDevice_Clicked" BackgroundColor="Transparent"/>
<StackLayout Orientation="Vertical" VerticalOptions="CenterAndExpand" HorizontalOptions="FillAndExpand">
<Label x:Name="deviceName" Text="" FontAttributes="Bold" FontSize="17" TextColor="Black" Margin="0,2,0,0" LineBreakMode="NoWrap"/>
<Label x:Name="deviceStatus" Text="50%" FontAttributes="None" FontSize="14" TextColor="#676767" Margin="0,-7"/>
<Label x:Name="deviceRoomName" Text="" FontAttributes="None" FontSize="12" TextColor="#676767" Margin="0,0,0,0" />
</StackLayout>
</StackLayout>
<StackLayout HorizontalOptions="EndAndExpand" TranslationX="40" x:Name="editImageButton">
<Grid>
<AbsoluteLayout Grid.Column="0">
<ImageButton Source="edit.png" BackgroundColor="Transparent" HorizontalOptions="EndAndExpand" VerticalOptions="CenterAndExpand" Margin="27,18,0,0"
Grid.Column="0" Grid.Row="0" Clicked="EditDevice_Clicked" WidthRequest="24" HeightRequest="24" />
</AbsoluteLayout>
<AbsoluteLayout Grid.Column="0">
<ImageButton CommandParameter="{Binding .}" Clicked="EditDevice_Clicked" BackgroundColor="Transparent" WidthRequest="50" HeightRequest="60"
Grid.Column="0" Grid.Row="0" AbsoluteLayout.LayoutBounds="1,0,50,60" AbsoluteLayout.LayoutFlags="PositionProportional" HorizontalOptions="EndAndExpand"
VerticalOptions="CenterAndExpand" Margin="0,0,0,0" />
</AbsoluteLayout>
</Grid>
</StackLayout>
<StackLayout HorizontalOptions="EndAndExpand">
<Grid>
<AbsoluteLayout Grid.Column="0">
<ImageButton Source="cancel.png" BackgroundColor="Transparent" HorizontalOptions="EndAndExpand" VerticalOptions="CenterAndExpand" Margin="7,18,0,0"
Grid.Column="0" Grid.Row="0" Clicked="drawerClose" WidthRequest="24" HeightRequest="24" />
</AbsoluteLayout>
<AbsoluteLayout Grid.Column="0">
<ImageButton CommandParameter="{Binding .}" Clicked="drawerClose" BackgroundColor="Transparent" WidthRequest="50" HeightRequest="60"
Grid.Column="0" Grid.Row="0" AbsoluteLayout.LayoutBounds="1,0,50,60" AbsoluteLayout.LayoutFlags="PositionProportional" HorizontalOptions="EndAndExpand"
VerticalOptions="CenterAndExpand" Margin="0,0,0,0" />
</AbsoluteLayout>
</Grid>
</StackLayout>
</StackLayout>
<StackLayout x:Name="bottomSlidePanel" Margin="0,-6,0,-9" Opacity="1" BackgroundColor="White" Grid.Row="1"/>
<StackLayout x:Name="slideBottomSection" Orientation="Vertical" BackgroundColor="Transparent" Grid.Row="2" Margin="0,2,0,0" VerticalOptions="EndAndExpand">
<Label x:Name="lblGray" BackgroundColor="#E5E4DF" HorizontalOptions="FillAndExpand" HeightRequest="32" Opacity="0.9" />
<StackLayout x:Name="stacFavSet" Orientation="Horizontal" VerticalOptions="Center" Opacity="1" BackgroundColor="White" Margin="0,-6" HeightRequest="44">
<Label Text="{translate:Translate Favorite}" TextColor="Black" FontSize="17" FontAttributes="None" VerticalOptions="CenterAndExpand" Margin="25,-6,0,-6"/>
<Switch x:Name="favSet" Style="{StaticResource SwitchStyle}" Toggled="Fav_ButtonClicked"/>
</StackLayout>
<StackLayout Orientation="Vertical" VerticalOptions="Center" Opacity="1" BackgroundColor="White" HeightRequest="44">
<Button Text="{translate:Translate Edit}" Clicked="EditDevice_Clicked" Focused="EditDevice_Clicked" Style="{StaticResource GoldButton}"/>
</StackLayout>
</StackLayout>
</Grid>
</telerikPrimitives:RadSideDrawer.DrawerContent>
</telerikPrimitives:RadSideDrawer>
</Grid>
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;
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;
}
}
var poco = CastJavaObject.Cast<Result>(dataItem);
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.
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
Hi Team,
Could you please help me how to scroll the RadCartesianChartView horizontally in Xamarin.Android.
Thank you!
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.
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>