Telerik Forums
UI for Xamarin Forum
0 answers
10 views

Hi Support,

I have a RadAutoCompleteView (see below definitions) and everything works except when the item is too long and it spans 2 rows in the result view. When user selects this long item and the drop down is closed, the selected item text is right aligned in the control. For example, the item shows like this in the drop down box:

1st line - Nursing and residential care facilities

2nd line - and long term care homes

User selects this item and returns to the control, they only see:

"facilities and long term care homes". User will need to press the home button in order to go to the start of the text. 

How do I code it so that the text is automatically left justified once returned from the result view into the control? Please help.

  <telerikInput:RadAutoCompleteView x:Name="MainAutoCompleteSectors" 
                                                              HeightRequest="35"
                                                              NoResultsMessage="No results." 
                                                              BorderThickness="1"
                                                              BorderColor="Silver"
                                                              SuggestionViewHeight="150"
                                                              ItemsSource="{Binding Sectors}"
                                                              TextSearchPath="CombinedName" 
                                                              BackgroundColor="White"
                                                              SuggestMode="Suggest"
                                                              CompletionMode="Contains" 
                                                              Watermark="Start typing here to start search..."
                                                              WatermarkTextColor="Black"
                                                              TextChanged="AutoCompleteSectors_TextChanged"
                                                              FontSize="12"
                                                              SearchThreshold="2"
                                                              TextColor="Black"
                                                              SuggestionItemTextColor="Black"
                                                              SuggestionItemSelected="Handle_SuggestionSectorItemSelected"
                                                              HorizontalOptions="FillAndExpand">
                                            <telerikInput:RadAutoCompleteView.SuggestionItemTemplate>
                                                <DataTemplate>
                                                    <ViewCell>
                                                        <autoCompleteView:SuggestionItemLabel TextColor="Black"
                                                            Padding="5,0"
                                                            HighlightTextColor="{StaticResource OrangeTextColor}"
                                                            UnformattedText="{Binding CombinedName}"
                                                            HighlightText="{Binding Source={x:Reference MainAutoCompleteSectors}, Path=Text}"/>
                                                    </ViewCell>
                                                </DataTemplate>
                                            </telerikInput:RadAutoCompleteView.SuggestionItemTemplate>

                                        </telerikInput:RadAutoCompleteView>

Vivian
Top achievements
Rank 1
 asked on 16 Jul 2021
1 answer
9 views

Hi support,

We would like to create a response drop down where we allow users to search for an item in the list. The drop down is bind to an observable collection in the VM called Response. Please see the definition of the combo box Response below.  

It seems to be working fine. User is able to search and select an item and the selected item is bound to ResponseSelected as specified. The only problem we are having is when the user clicks on the control but did not select an item and clicks on another combo box with similar definitions (see Employees combo box below). The application hangs and it looks like it went into an infinite loop. This 'hanging' issue also appears if you keep clicking on the combo box (either Response or Employees) multiple times.

If we change IsEditable in the combo box definitions to False on both combo boxes, the hanging issue goes away. Are we doing something wrong? Please help.

<telerikInput:RadComboBox Grid.Row="0" Grid.Column="0"
                                          ItemsSource="{Binding Response}" DropDownBackgroundColor="White"
                                          DisplayMemberPath="Description"
                                          TextColor="{StaticResource SilverTextColor}"                        
                                          SearchTextPath="Description"
                                          SearchMode="Contains"
                                          Placeholder="select a response..."
                                          PlaceholderColor="White"
                                          FontSize="12"
                                          SelectionMode="Single"
                                          HorizontalOptions="FillAndExpand"
                                          Margin="10,5,10,0"
                                          SelectedItem="{Binding ResponseSelected, Mode=TwoWay}"
                                          HighlightTextColor="DarkOrange"
                                          IsDropDownClosedOnSelection="True"
                                          IsEditable="True">
                                        <telerikInput:RadComboBox.SelectedItemTemplate>
                                            <DataTemplate>
                                                <StackLayout BackgroundColor="White">
                                                    <Label Text="{Binding Description}" Style="{StaticResource labelStyle}" Margin="5,5,0,5" TextColor="Black" />
                                                </StackLayout>
                                            </DataTemplate>
                                        </telerikInput:RadComboBox.SelectedItemTemplate>

                                    </telerikInput:RadComboBox>

 

   <telerikInput:RadComboBox ItemsSource="{Binding Employees}" DropDownBackgroundColor="White"
                                          DisplayMemberPath="FullName"
                                          TextColor="{StaticResource SilverTextColor}"                        
                                          SearchTextPath="FullName"
                                          SearchMode="Contains"
                                          Placeholder="select an employee..."
                                          PlaceholderColor="White"
                                          FontSize="12"
                                          SelectionMode="Single"
                                          Margin="0,0,10,0" 
                                          HorizontalOptions="FillAndExpand"
                                          SelectedItem="{Binding EmployeeSelected, Mode=TwoWay}"
                                          HighlightTextColor="DarkOrange"
                                          IsDropDownClosedOnSelection="True"
                                          IsEditable="True">
                                        <telerikInput:RadComboBox.SelectedItemTemplate>
                                            <DataTemplate>
                                                <StackLayout BackgroundColor="White">
                                                    <Label Text="{Binding FullName}" Style="{StaticResource labelStyle}" Margin="5,5,0,5" TextColor="Black" />
                                                </StackLayout>
                                            </DataTemplate>
                                        </telerikInput:RadComboBox.SelectedItemTemplate>

                                    </telerikInput:RadComboBox>
Didi
Telerik team
 updated answer on 15 Jul 2021
1 answer
12 views

I just used the approach outlined in the link below to set a custom color for the selected row in my RadGridView control.

WPF DataGrid | SelectedBackground and MouseOverBackground | Telerik UI for WPF

This approach seems to have worked just fine for the case when the user clicks on a row to select it.  However, when the SelectedItem property of the grid view is set in code through data binding, the selected row color reverts to the default value.  Only upon clicking the row again does it display using the color that I defined.

Am I missing something?

Thanks!

Stenly
Telerik team
 answered on 13 Jul 2021
0 answers
9 views

LocalDataSourceProvider.ProcessCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedEventArgs e)

System.AggregateException: Object reference not set to an instance of an object

STACKTRACE:

Object reference not set to an instance of an object
  at Telerik.XamarinForms.Common.Data.LocalDataSourceProvider.ProcessCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x0000f] in <9e9b25dc0d3245a29ae02ea29570dc43>:0 
  at Telerik.XamarinForms.Common.Data.LocalDataSourceProvider.ProcessPendingChanges () [0x0001b] in <9e9b25dc0d3245a29ae02ea29570dc43>:0 
  at Telerik.XamarinForms.Common.Data.LocalDataSourceProvider.OnCompleted (System.Object sender, Telerik.XamarinForms.Common.Data.DataEngineCompletedEventArgs e) [0x00027] in <9e9b25dc0d3245a29ae02ea29570dc43>:0 
  at Telerik.XamarinForms.Common.Data.ParallelDataEngine.RaiseCompleted (Telerik.XamarinForms.Common.Data.DataEngineCompletedEventArgs args) [0x0000f] in <9e9b25dc0d3245a29ae02ea29570dc43>:0 
  at Telerik.XamarinForms.Common.Data.ParallelDataEngine.ProcessBottomLevelsParallel (System.Threading.Tasks.Task`1[TResult] bottomLevelResultsTask, Telerik.XamarinForms.Common.Data.ParallelState parallelState) [0x0016d] in <9e9b25dc0d3245a29ae02ea29570dc43>:0 
  at Telerik.XamarinForms.Common.Data.ParallelDataEngine+<>c__DisplayClass99_0.<BeginParallelProcessing>b__1 (System.Threading.Tasks.Task`1[TResult] task) [0x00000] in <9e9b25dc0d3245a29ae02ea29570dc43>:0 
  at System.Threading.Tasks.ContinuationTaskFromResultTask`1[TAntecedentResult].InnerInvoke () [0x00024] in <32cbdb1c0c3b4511b16bf95f79c88845>:0 
  at System.Threading.Tasks.Task.Execute () [0x00000] in <32cbdb1c0c3b4511b16bf95f79c88845>:0 
Ajaysinh
Top achievements
Rank 1
 asked on 12 Jul 2021
1 answer
10 views

Hi,

I'm trying to change the text color & size of RadListPicker popup,

ItemStyle="{StaticResource ItemStyle}"

 <Style TargetType="telerikDataControls:SpinnerItemView" x:Key="ItemStyle">
            <Setter Property="BackgroundColor" Value="#2a3137"/>
            <Setter Property="TextColor" Value="#f00" />
            <Setter Property="FontSize" Value="14"/>
</Style>

these highlighted values are not applying to the view, but BackgroundColor applying...

Please give me a solution to this issue.

Thanks

         
Didi
Telerik team
 answered on 12 Jul 2021
1 answer
11 views

Hi, 

I'm trying to change the color of telerikInput:RadAutoCompleteView close icon, default it's dark,

I need to assign a color to it, can anyone help me

 

0 answers
4 views
I have a project that has multiple NumericInputs and RadEntries on multiple rows on a RadList. This has been fine but I have now found on iOS devices the _Unfocused event is being fired for no reason, I have tried debugging and I believe that it is happening because another found field is updating but this field is not bound to the controls so I don't see how that is possible. Is there a better way to debug this?
Simon
Top achievements
Rank 1
Veteran
 asked on 05 Jul 2021
2 answers
13 views

Hi,

i am trying to create a graph, as can be seen in picture Chart.png.

But i found no property to set the start value of the logarithmic axis (default start value is 1 but i need 125).

How can i change the display range of the TKChartNumericAxis? And it is possible to invert the y axis (like in the screenshot)?

My current code:
var chart = new TKChart
{
    XAxis = new TKChartLogarithmicAxis
    {
        LogarithmBase = 2
    },
    YAxis = new TKChartNumericAxis(NSObject.FromObject(-10), NSObject.FromObject(120)),
    Frame = StackLayout.Bounds.ToRectangleF()
};

chart.Title.Hidden = true;
chart.Legend.Hidden = true;

var list = new NSObject[]
{
    new TKChartDataPoint(new NSNumber(500), new NSNumber(70)),
    new TKChartDataPoint(new NSNumber(1000), new NSNumber(40)),
    new TKChartDataPoint(new NSNumber(2000), new NSNumber(60)),
    new TKChartDataPoint(new NSNumber(4000), new NSNumber(50))
};

var series = new TKChartLineSeries(list);
chart.AddSeries(series);

Marco
Top achievements
Rank 1
Iron
 answered on 01 Jul 2021
1 answer
14 views

I am working on Xamarin Forms and I have to create a Datagrid programmatically with dynamic custom control where controls may have selected value or default value. Here column and controls are not predefined. I have asked two more questions before regarding this issue and the Telerik forum really helped me out. But the scenario is something else. Whenever I load Datagrid with existing data it is unable to keep row identity, all of those rows hold the same view with the same default/selected value as well. Is there any other way to bind new rows with dynamic custom controls instead of adding new data in ItemsSource. 

My current approach is: 

private readonly RadDataGrid dataGrid = new RadDataGrid() { IsEnabled = true, AutoGenerateColumns = false, HeightRequest = Application.Current.MainPage.Height * 57 / 100, IsClippedToBounds = true }; private ObservableCollection<dynamic> dataSource = new ObservableCollection<dynamic>(); private List<Element> Elements = new List<Element>(); public async Task DoSetup() { dataGrid.SelectionMode = DataGridSelectionMode.Single; dataGrid.SelectionUnit = DataGridSelectionUnit.Row; //dataGrid. += (s, e) => DataGrid_SelectionChanged(s, e); dataGrid.UserFilterMode = DataGridUserFilterMode.Disabled; dataGrid.UserGroupMode = DataGridUserGroupMode.Disabled; dataGrid.UserSortMode = DataGridUserSortMode.None; dataGrid.ItemsSource = dataSource; AddHeaderRow(); } private void AddHeaderRow() { var columnWidth = (Application.Current.MainPage.Width - 25) / Elements.Count; this.dataGrid.Columns.Add(new DataGridTemplateColumn { SizeMode = DataGridColumnSizeMode.Fixed, Width = 25, Name = "actionbtn", CanUserFilter = false, CanUserGroup = false, CanUserSort = false, CanUserEdit = true, HeaderStyle = new DataGridColumnHeaderStyle { OptionsButtonTextColor = Color.Transparent, OptionsButtonFontSize = 0, BorderColor = Color.FromHex("#D9D9D9"), BorderThickness = new Thickness(0) }, CellContentTemplate = GetActionButtonIcon() //return trash icon }); foreach (ApiClient.Models.IElement element in Elements) { this.dataGrid.Columns.Add(new DataGridTemplateColumn { SizeMode = DataGridColumnSizeMode.Fixed, Width = columnWidth, HeaderText = element.DisplayName, Name = element.DisplayName, CanUserFilter = false, CanUserGroup = false, CanUserSort = false, CanUserEdit = true, HeaderStyle = new DataGridColumnHeaderStyle { OptionsButtonTextColor = Color.Transparent, OptionsButtonFontSize = 0, BorderColor = Color.FromHex("#D9D9D9"), BorderThickness = new Thickness(0) }, CellContentTemplate = GetTemplate(element) }); } } private DataTemplate GetTemplate(Element element) { return new DataTemplate(() => { var stackLayout = new StackLayout(); var view = GetView(element); //return dynamic custom controls based on element type stackLayout.Children.Add(view); return stackLayout; }); }

DataTemplateSelector may solve this issue, but didn't find any solution yet using DataTemplateSelector.

  • Which one is the correct approach?
  • How do I implement DataTemplateSelector for dynamic custom controls? 
Yana
Telerik team
 answered on 01 Jul 2021
13 answers
360 views

Hi!

After upgrade to Telerik UI for Xamarin R1 2021.

Content pages that use RadListView will throw System.TypeLoadException error:

03-01 09:37:41.966 D/Mono    ( 1041): Assembly Ref addref Telerik.XamarinForms.DataControls[0xe92528e0] -> System.Core[0xd1e0b8a0]: 11
03-01 09:37:41.966 W/        ( 1041): Could not load signature of Telerik.XamarinForms.DataControlsRenderer.Android.ListViewAccessibilityDelegateCompat:OnInitializeAccessibilityNodeInfo due to: Could not resolve type with token 01000150 from typeref (expected class 'AndroidX.Core.View.Accessibiity.AccessibilityNodeInfoCompat' in assembly 'Xamarin.AndroidX.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null') assembly:Xamarin.AndroidX.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null type:AndroidX.Core.View.Accessibiity.AccessibilityNodeInfoCompat member:(null)
**System.TypeLoadException:** 'VTable setup of type Telerik.XamarinForms.DataControlsRenderer.Android.ListViewAccessibilityDelegateCompat failed'
 
 
**System.TypeLoadException:** 'VTable setup of type Telerik.XamarinForms.DataControlsRenderer.Android.ListViewAccessibilityDelegateCompat failed'
 
**System.NotImplementedException:** 'The method or operation is not implemented.'
 
03-01 09:58:44.813 W/        ( 2622): exception inside UnhandledException handler: (null) assembly:mscorlib.dll type:NotImplementedException member:(null)
03-01 09:58:44.813 E/mono-rt ( 2622): [ERROR] FATAL UNHANDLED EXCEPTION: System.TypeLoadException: VTable setup of type Telerik.XamarinForms.DataControlsRenderer.Android.ListViewAccessibilityDelegateCompat failed
03-01 09:58:44.813 E/mono-rt ( 2622):   at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.42(intptr,intptr,intptr,intptr,intptr)
03-01 09:58:44.813 E/mono-rt ( 2622):   at (wrapper native-to-managed) Android.Runtime.DynamicMethodNameCounter.42(intptr,intptr,intptr,intptr,intptr)

 

My app will crash after that exception thrown. How to fix this problem?

Thanks!

 

 

Oleg
Top achievements
Rank 1
Iron
 updated answer on 30 Jun 2021
Top users last month
Psyduck
Top achievements
Rank 4
Bronze
Iron
Iron
Om Pushkara deep
Top achievements
Rank 2
Iron
Iron
Iron
Valery
Top achievements
Rank 1
Iron
Peter
Top achievements
Rank 1
Veteran
Iron
George C.
Top achievements
Rank 2
Iron
Veteran