Telerik Forums
UI for Xamarin Forum
1 answer
171 views

Hi,

we war using the Telerik Calender in a MasterDetailPage as Master und the Information of the Date is in the Detail visualized. The new requirements are the App has to be a full physical Keyboard accessibility.

The MasterDetailpage is inside a Tappedpage. Only if a change the TappedPage, then the Calendar (Masterdetailpage -> Master) gets the keyboard focus. Wen i use the Tabulator-Key ("TAB") then the focus changed to the Detail and all other Elements, but the Calendar gets never the focus again (there Skip the Calendar).

the Calendar gets only the Focus, when ...

1. the TappedPage changes (between tabs)

2. use the key "Shift + Tabulator"

 

is there a way to fix the Tabindex or to force the Calendar to request the keyboard focus? In MasterDetailPages without the Calendar there is no problem. i tried to set "Tabindex", "IsTabStop", "Focused-Event" etc. without an effect.

 

Thanks :)

Imotek

Yana
Telerik team
 answered on 02 Jun 2021
1 answer
154 views

I need to create a RadDataGrid where rows are dynamic custom control coming from API. I had asked a question before and it's helped me a lot. But currently, I cannot work more than one row. The first-row creation is very fine it's working so nicely with my custom controls, but not for the rest rows.  

If I use Label it works, but not in a dynamic custom control.

 


private void AddHeaderRowNew(IEnumerable<string> headers)
        {


            Feature newTree = (this.Parent as Home).GetNewTree();

            Dto.FeatureContainer container = Controls.ControlFactory.GetContainer(this.Template, newTree, this.Olp.AppProject.Layout.MetaTree,
                FeatureState.New,
                this.TreeRules,
                ApiClient.Models.RuleTarget.Tree);

            var views = container.GetViews(this.SimpleTreeElementIds);

            int index = 0;

            var columnWidth = Application.Current.MainPage.Width / headers.Count();

            foreach (string header in headers)
            {
                var view = views[index];
                columns.Add(header);
                this.dataGrid.Columns.Add(new DataGridTemplateColumn { SizeMode = DataGridColumnSizeMode.Fixed, Width = columnWidth, HeaderText = header, Name = header, CanUserFilter = false, CanUserGroup = false, CanUserSort = false, CanUserEdit = true, HeaderStyle = new DataGridColumnHeaderStyle { BorderThickness = new Thickness(0) }, CellContentTemplate = GetTemplate(view) });
                index++;
            }
        }


        public DataTemplate GetTemplate(View view) //working only for first row
        {
            return new DataTemplate(() =>
            {
                var stackLayout = new StackLayout();

                stackLayout.Children.Add(view);

                return stackLayout;
            });
        }

        public DataTemplate GetTemplate(string text) //working fine
        {
            return new DataTemplate(() =>
            {
                var stackLayout = new StackLayout();

                Label oLabel = new Label()
                {
                    BackgroundColor = Color.Transparent,
                    TextColor = Color.Black,
                    VerticalOptions = LayoutOptions.FillAndExpand,
                    HorizontalOptions = LayoutOptions.FillAndExpand,
                };

                //oLabel.SetBinding(Label.TextProperty, psPropertyName);
                oLabel.Text = text;

                stackLayout.Children.Add(oLabel);

                return stackLayout;
            });
        }
Have any idea to solve it? 
Yana
Telerik team
 answered on 02 Jun 2021
0 answers
249 views

Hi,

I have a collection of items. They are grouped by one of the fields (DestinationName). For that behavior I'm using RadListView with a specified GroupHeaderTemplate. In every group set, each item has a switch button and a name. 

What I want to add is a switch button in the header of the group, which will change each of the inner switches once it's triggered. For example, if the outer switch is selected, all inner switches should be also marked as selected. Is that possible using that component?

Here's the code:

 <telerikDataControls:RadListView
                ItemsSource="{Binding Machines}"
                GroupDescriptors="{Binding GroupDescriptors, Mode=OneWayToSource}"  
                GroupHeaderStyle="{StaticResource ListViewGroupHeaderStyle}">
                <telerikDataControls:RadListView.GroupHeaderTemplate>
                    <DataTemplate>
                        <Grid BackgroundColor="{AppThemeBinding Light=White, Dark={StaticResource EntryBlack}}">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition />
                            </Grid.ColumnDefinitions>
                            <Label Text="&#x25B8;" Margin="8, 5, 0, 5" TextColor="{AppThemeBinding Light={StaticResource EntryBlack}, Dark=White}" FontSize="{StaticResource MediumFontSize}">
                                <Label.Triggers>
                                    <DataTrigger TargetType="Label" Binding="{Binding IsExpanded}" Value="True">
                                        <Setter Property="Text" Value="&#x25BE;" />
                                    </DataTrigger>
                                </Label.Triggers>
                            </Label>
                            <Label 
                                Margin="0, 5, 0, 5" 
                                Text="{Binding }" 
                                Grid.Column="1" 
                                TextColor="{AppThemeBinding Light={StaticResource EntryBlack}, Dark=White}" 
                                FontSize="{StaticResource MediumFontSize}" 
                                HorizontalOptions="Start" />

                            <Switch 
                                Grid.Column="2" 
                                HorizontalOptions="End" 
                                VerticalOptions="Start" />
                        </Grid>
                    </DataTemplate>
                </telerikDataControls:RadListView.GroupHeaderTemplate>
                <telerikDataControls:RadListView.ItemTemplate>
                    <DataTemplate>
                        <telerikListView:ListViewTemplateCell>
                            <telerikListView:ListViewTemplateCell.View>
                                <Grid Margin="0" BackgroundColor="{AppThemeBinding Light=White, Dark={StaticResource EntryBlack}}">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition Width="*" />
                                    </Grid.ColumnDefinitions>

                                    <Switch IsToggled="{Binding Selected}" HorizontalOptions="Start" VerticalOptions="Start" OnColor="#860327" ThumbColor="#cccccc" Margin="10, 0, 0, 0"/>
                                    <Label Grid.Column="1" Text="{Binding MachineName}" Style="{StaticResource ContentItemTextTransperantStyle}" FontSize="14" Margin="13, 0, 0, 0" />
                                </Grid>
                            </telerikListView:ListViewTemplateCell.View>
                        </telerikListView:ListViewTemplateCell>
                    </DataTemplate>
                </telerikDataControls:RadListView.ItemTemplate>
            </telerikDataControls:RadListView>

 

Thank you in advance!

Martin
Top achievements
Rank 1
 asked on 20 May 2021
0 answers
240 views
Telerik.ui.for.Xamarin v 2021.1.224.1

System.MethodAccessException: Method `Telerik.Windows.Documents.Fixed.Utilities.Rendering.PageLayoutHelper.CalculatePageBoundingRectangle(Telerik.Windows.Documents.Fixed.Model.Common.IFixedPage)' is inaccessible from method `Telerik.XamarinForms.PdfViewer.PdfUtilities.GetPageSize(Telerik.Windows.Documents.Fixed.Model.RadFixedPage)'
  at (wrapper managed-to-native) System.Object.__icall_wrapper_mono_throw_method_access(intptr,intptr)
  at Telerik.XamarinForms.PdfViewer.PdfUtilities.GetPageSize (Telerik.Windows.Documents.Fixed.Model.RadFixedPage page) [0x00000] in <136b85164c274f2fa1cf0f48d0e3f200>:0 
  at Telerik.XamarinForms.PdfViewer.Presenters.VerticallyStackedPagesStrategy.TryGetSameHeight (Telerik.Windows.Documents.Fixed.Model.Collections.PageCollection pages) [0x0001b] in <136b85164c274f2fa1cf0f48d0e3f200>:0 
  at Telerik.XamarinForms.PdfViewer.Presenters.VerticallyStackedPagesStrategy.TryCreatePageTuple (Telerik.XamarinForms.PdfViewer.DocumentInfo documentInfo) [0x0004d] in <136b85164c274f2fa1cf0f48d0e3f200>:0 
  at Telerik.XamarinForms.PdfViewer.Presenters.VerticallyStackedPagesStrategy.UpdatePageInfos () [0x00024] in <136b85164c274f2fa1cf0f48d0e3f200>:0 
  at Telerik.XamarinForms.PdfViewer.Presenters.VerticallyStackedPagesStrategy.OnDocumentChanged () [0x00000] in <136b85164c274f2fa1cf0f48d0e3f200>:0 
  at Telerik.XamarinForms.PdfViewer.FixedDocumentContinuousPresenterV2.OnDocumentInfoChangedOverride () [0x00025] in <136b85164c274f2fa1cf0f48d0e3f200>:0 
  at Telerik.XamarinForms.PdfViewer.FixedDocumentPresenterBase.set_DocumentInfo (Telerik.XamarinForms.PdfViewer.DocumentInfo value) [0x00010] in <136b85164c274f2fa1cf0f48d0e3f200>:0 
  at Telerik.XamarinForms.PdfViewer.RadPdfViewer.OnDocumentInfoChanged (Telerik.XamarinForms.PdfViewer.DocumentInfo oldValue, Telerik.XamarinForms.PdfViewer.DocumentInfo newValue) [0x00009] in <136b85164c274f2fa1cf0f48d0e3f200>:0 
  at Telerik.XamarinForms.PdfViewer.RadPdfViewer.set_DocumentInfo (Telerik.XamarinForms.PdfViewer.DocumentInfo value) [0x00017] in <136b85164c274f2fa1cf0f48d0e3f200>:0 
  at Telerik.XamarinForms.PdfViewer.RadPdfViewer.OnDocumentChanged () [0x00015] in <136b85164c274f2fa1cf0f48d0e3f200>:0 
  at Telerik.XamarinForms.PdfViewer.RadPdfViewer.OnPropertyChanged (System.String propertyName) [0x0000d] in <136b85164c274f2fa1cf0f48d0e3f200>:0 
  at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.Internals.SetValueFlags attributes, System.Boolean silent) [0x00114] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:510 
  at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) [0x00173] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:446 
  at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value, System.Boolean fromStyle, System.Boolean checkAccess) [0x0004d] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:374 
  at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindablePropertyKey propertyKey, System.Object value) [0x0000e] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:356 
  at Telerik.XamarinForms.PdfViewer.RadPdfViewer.SetDocument (Telerik.Windows.Documents.Fixed.Model.RadFixedDocument value) [0x00000] in <136b85164c274f2fa1cf0f48d0e3f200>:0 
  at Telerik.XamarinForms.PdfViewer.RadPdfViewer.UpdateDocumentFromSource () [0x0001a] in <136b85164c274f2fa1cf0f48d0e3f200>:0 
  at Telerik.XamarinForms.PdfViewer.RadPdfViewer.Source_PropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs e) [0x00012] in <136b85164c274f2fa1cf0f48d0e3f200>:0 
  at Telerik.XamarinForms.Common.NotifyPropertyChangedBase.OnPropertyChanged (System.String propertyName) [0x00015] in <1c319f0f665e4035ab8e82495214d254>:0 
  at Telerik.XamarinForms.PdfViewer.DocumentSource.set_Document (Telerik.Windows.Documents.Fixed.Model.RadFixedDocument value) [0x0002c] in <136b85164c274f2fa1cf0f48d0e3f200>:0 
  at Telerik.XamarinForms.PdfViewer.DocumentSource.SetDocumentStreamTuple (Telerik.XamarinForms.PdfViewer.DocumentStreamTuple value) [0x0001e] in <136b85164c274f2fa1cf0f48d0e3f200>:0 
  at Telerik.XamarinForms.PdfViewer.StreamDocumentSource+<>c__DisplayClass18_1.<UpdateDocumentFromStreamFunc>b__2 () <0x153447728 + 0x00056> in <136b85164c274f2fa1cf0f48d0e3f200#897a8708db8305ecb598233d4a92b40f>:0 
  at Foundation.NSAsyncActionDispatcher.Apply () [0x00000] in /Users/builder/azdo/_work/2/s/xamarin-macios/src/Foundation/NSAction.cs:152 
  at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
  at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Users/builder/azdo/_work/2/s/xamarin-macios/src/UIKit/UIApplication.cs:86 
  at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0000e] in /Users/builder/azdo/_work/2/s/xamarin-macios/src/UIKit/UIApplication.cs:65 
  at Kpmg.Constellation.Mobile.iOS.Application.Main (System.String[] args) [0x00002] in /Users/ananeabdeljalil/GitSource/myPulseV2/Constellation.Mobile/src/Kpmg.Constellation.Mobile.iOS/Main.cs:18 
Mondher
Top achievements
Rank 1
 asked on 20 May 2021
1 answer
313 views
Hello, I am debugging using an android device and it just can't seem to hit my breakpoint for the Focused event even though other event does like PropertyChanged. My app uses Telerik UI 2020.3.1106.1 and Xamarin Forms 4.8.0.1821.
Didi
Telerik team
 answered on 17 May 2021
1 answer
127 views
Is there a way to add a placeholder in RichTextEditor when it's empty? Thanks.
Yana
Telerik team
 answered on 14 May 2021
1 answer
248 views

Hi, I need to create RadDataGrid in xamarin forms programmatically. it only creates the header and it's fine. But when I insert new data in ItemSource there has no new row added in UI while ItemSource already updated with new row data. I have tried in several ways and still, there has no progress. Have any other options to add a data row in RadDataGrid? code snippets are attached.

 


  private readonly RadDataGrid dataGrid = new RadDataGrid() { IsEnabled = true, AutoGenerateColumns = false };
  private List<GridModel> dataSource = new List<GridModel>(); 

  public async Task DoSetup()
        {
             Grid outermost = this.GetOutermostGrid();
             this.Content = outermost;
             AddHeaderRow(columsList);
             dataGrid.ItemsSource = dataSource;
             outermost.Children.Add(dataGrid);
             Grid.SetColumn(dataGrid, 0);
        }

private void AddHeaderRow(IEnumerable<string> headers)
        {
            foreach (string s in headers)
            {
                this.dataGrid.Columns.Add(new DataGridTextColumn() { HeaderText = s, SizeMode = DataGridColumnSizeMode.Stretch, Name = s, PropertyName = s });
            }
        }

private void AddNewRow(GridModel model)
        {
            //dataSource.Add(model);
            //dataGrid.ItemsSource = dataSource;
            (dataGrid.ItemsSource as List<GridModel>).Add(model);
        }

Lance | Senior Manager Technical Support
Telerik team
 answered on 30 Apr 2021
1 answer
178 views

Im trying to install Telerik UI for Xamarin tools for Visual Studio for Mac by following the instructions here. Section "Download the controls", step 5.

When opening the "ProjectTemplateXamarin.mpack" file. I get the following error message:

The selected extension packages can't be installed because there are dependency conflicts. The package '::Xamarin.FormsPreviewer v4.15' could not be found in any repository.

The following packages will be installed: Telerik Xamarin Add-in v2021.1.413 (in user directory)

The follwing dependencies could not be resolved: ::Xamarin.FormsPreviewer v4.15

------------------------------------------------------------------------------------------------------------

What can I do to resolve this issue? Is there another way to install the extensions?

I assume this error has something to do with the warning bulletin in this article.

 

Thank you

Yana
Telerik team
 answered on 29 Apr 2021
6 answers
373 views
Hello, I am using the rich text editor to edit large word documents.
 
I noticed that if the screen rotation happens from portrait to landscape, all the content will shrink to the left part, with the right half empty,.and cannot be fixed unless you rotate it back.
 
Actually even when initially loaded, the horizontal scrollbar is wider than the content, which might be the reason causing the problem?
 

 
Is there a way to fit the scrollbars to the content, and make it display as expected during device rotation ?
 
I really needs to fix this 
 
Regards
Yana
Telerik team
 answered on 21 Apr 2021
1 answer
442 views

Hello good afternoon, I have a problem since I updated to the most current versions of Xamarin.Forms and Telerik.

I had a ScrollView that was the parent of a RadTabView, and when switching between Tab items it updated as heights normally.

But after the update it records only the first height of the content of the first item and when I switch to the other items the scroll does not work because the height of the Tab does not change and he is unable to make a difference to calculate how much will roll.

 

EX:

 

 <ScrollView x:Name="s"
              BackgroundColor="Azure">
        <telerikPrimitives:RadTabView x:Name="tabView"
                                          BackgroundColor="Blue"
                                          IsContentSwipingEnabled="False">
            <telerikPrimitives:RadTabView.Items>
                <telerikPrimitives:TabViewItem HeaderText="Home">
                    <telerikPrimitives:TabViewItem.Content>
                        <StackLayout x:Name="sta"
                                         BackgroundColor="Aquamarine">

                            <StackLayout.GestureRecognizers>
                                <TapGestureRecognizer Tapped="st1" />
                            </StackLayout.GestureRecognizers>

                            <Label Margin="10" Text="This is the content of the Home tabdfoihdsoifhsoidhfoisdhfoishfois"
                               HeightRequest="50"
                               BackgroundColor="Red"/>
                            <Label Margin="10" Text="This is the content of the Home tabdfoihdsoifhsoidhfoisdhfoishfois"
                               HeightRequest="50"
                               BackgroundColor="Red"/>
                        </StackLayout>
                    </telerikPrimitives:TabViewItem.Content>
                </telerikPrimitives:TabViewItem>
                <telerikPrimitives:TabViewItem HeaderText="Folder">
                    <telerikPrimitives:TabViewItem.Content>
                        <StackLayout x:Name="stb"
                                         BackgroundColor="Firebrick">

                            <StackLayout.GestureRecognizers>
                                <TapGestureRecognizer Tapped="st2" />
                            </StackLayout.GestureRecognizers>

                            <Label Margin="10" Text="This is the content of the Home tabdfoihdsoifhsoidhfoisdhfoishfois"
                               HeightRequest="50"
                               BackgroundColor="Red"/>
                            <Label Margin="10" Text="This is the content of the Home tabdfoihdsoifhsoidhfoisdhfoishfois"
                               HeightRequest="50"
                               BackgroundColor="Red"/>
                            <Label Margin="10" Text="This is the content of the Home tabdfoihdsoifhsoidhfoisdhfoishfois"
                               HeightRequest="50"
                               BackgroundColor="Red"/>
                            <Label Margin="10" Text="This is the content of the Home tabdfoihdsoifhsoidhfoisdhfoishfois"
                               HeightRequest="50"
                               BackgroundColor="Red"/>
                            <Label Margin="10" Text="This is the content of the Home tabdfoihdsoifhsoidhfoisdhfoishfois"
                               HeightRequest="50"
                               BackgroundColor="Red"/>
                            <Label Margin="10" Text="This is the content of the Home tabdfoihdsoifhsoidhfoisdhfoishfois"
                               HeightRequest="50"
                               BackgroundColor="Red"/>
                        </StackLayout>
                    </telerikPrimitives:TabViewItem.Content>
                </telerikPrimitives:TabViewItem>
                <telerikPrimitives:TabViewItem HeaderText="View">
                    <telerikPrimitives:TabViewItem.Content>
                        <StackLayout x:Name="stc"
                                         BackgroundColor="DodgerBlue">

                            <StackLayout.GestureRecognizers>
                                <TapGestureRecognizer Tapped="st3" />
                            </StackLayout.GestureRecognizers>

                            <Label Margin="10" Text="This is the content of the Home tabdfoihdsoifhsoidhfoisdhfoishfois"
                               HeightRequest="50"
                               BackgroundColor="Red"/>
                            <Label Margin="10" Text="This is the content of the Home tabdfoihdsoifhsoidhfoisdhfoishfois"
                               HeightRequest="50"
                               BackgroundColor="Red"/>
                            <Label Margin="10" Text="This is the content of the Home tabdfoihdsoifhsoidhfoisdhfoishfois"
                               HeightRequest="50"
                               BackgroundColor="Red"/>
                            <Label Margin="10" Text="This is the content of the Home tabdfoihdsoifhsoidhfoisdhfoishfois"
                               HeightRequest="50"
                               BackgroundColor="Red"/>
                            <Label Margin="10" Text="This is the content of the Home tabdfoihdsoifhsoidhfoisdhfoishfois"
                               HeightRequest="50"
                               BackgroundColor="Red"/>
                            <Label Margin="10" Text="This is the content of the Home tabdfoihdsoifhsoidhfoisdhfoishfois"
                               HeightRequest="50"
                               BackgroundColor="Red"/>
                            <Label Margin="10" Text="This is the content of the Home tabdfoihdsoifhsoidhfoisdhfoishfois"
                               HeightRequest="50"
                               BackgroundColor="Red"/>
                            <Label Margin="10" Text="This is the content of the Home tabdfoihdsoifhsoidhfoisdhfoishfois"
                               HeightRequest="50"
                               BackgroundColor="Red"/>
                            <Label Margin="10" Text="This is the content of the Home tabdfoihdsoifhsoidhfoisdhfoishfois"
                               HeightRequest="50"
                               BackgroundColor="Red"/>
                            <Label Margin="10" Text="This is the content of the Home tabdfoihdsoifhsoidhfoisdhfoishfois"
                               HeightRequest="50"
                               BackgroundColor="Red"/>
                            <Label Margin="10" Text="This is the content of the Home tabdfoihdsoifhsoidhfoisdhfoishfois"
                               HeightRequest="50"
                               BackgroundColor="Red"/>
                            <Label Margin="10" Text="This is the content of the Home tabdfoihdsoifhsoidhfoisdhfoishfois"
                               HeightRequest="50"
                               BackgroundColor="Red"/>
                            <Label Margin="10" Text="This is the content of the Home tabdfoihdsoifhsoidhfoisdhfoishfois"
                               HeightRequest="50"
                               BackgroundColor="Red"/>
                            <Label Margin="10" Text="This is the content of the Home tabdfoihdsoifhsoidhfoisdhfoishfois"
                               HeightRequest="50"
                               BackgroundColor="Red"/>
                            <Label Margin="10" Text="This is the content of the Home tabdfoihdsoifhsoidhfoisdhfoishfois"
                               HeightRequest="50"
                               BackgroundColor="Red"/>
                        </StackLayout>
                    </telerikPrimitives:TabViewItem.Content>
                </telerikPrimitives:TabViewItem>
            </telerikPrimitives:RadTabView.Items>
        </telerikPrimitives:RadTabView>
    </ScrollView>

 

Ao mudar para o terceiro item da Tab ele não entende que deve fazer scroll.

 

Porf se alguém puder ajudar, agradeço.

Didi
Telerik team
 answered on 19 Apr 2021
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?