Telerik Forums
UI for Xamarin Forum
3 answers
1.0K+ views

I have a scenario where I have "dynamic" content in a listview. I am making a sort of chat application where you can send hyperlinks, images, videos, etc.

I have a template defined in XAML for an incoming message and outgoing message, but I need to be able to say "this message has an image", "this message has a link", "this message has a text body with a link in the middle of it", "this message has both text and 2 images", etc.

How can I dynamically set what content is in each listview item without having to define a bunch of things that are IsVisible="true/false"?

Lance | Senior Manager Technical Support
Telerik team
 answered on 21 Jun 2019
5 answers
73 views

I need to know if it's possible to change animation direction for the wrap when navigating the SlideView by SelectedIndex, so IsInfinateScrolling works with SelectedIndex navigation.  

When navigating from the last element in the collection, back to the first, or from first element directly to the last by updating the Bound SelectedIndex property is there a way to reverse the animation?

When IsInfiniteScrollingEnabled="True" I believe that the animation should continue in the same direction even when you're wrapping from the last element to the first, or the first element to the last so you can have a seamless infinite navigation experience.  

 

(the --> and <-- below are animation direction)

Current:(IsInfiniteScrollingEnabled="True") 

SelectedIndex=0 

SelectedIndex=1 -->

SelectedIndex=2 -->

(Last item)SelectedIndex=3 -->

SelectedIndex=0 <--  (This animation is opposite of the last several)

 

Desired:(IsInfiniteScrollingEnabled="True")

SelectedIndex=0
SelectedIndex=1 -->
SelectedIndex=2 -->
(Last item)SelectedIndex=3 -->
SelectedIndex=0 --> (Same direction as last animation)

Is this currently possible in the SlideView Control?

John
Top achievements
Rank 1
 answered on 20 Jun 2019
3 answers
153 views

In Xamarin forms calendar day view on one hour time slot, We are unable to perform time slot tapped event when an appointment exists for that hour. 

For example, If an appointment is on time 6.30 am to 7.00 am we are unable to add new appointment on time 6.00 am to 6.30 am, since the existing appointment is disabling the blank area above.

And also if one appointment exists for that whole one hour then it is occupying the whole time slot area, so there is no blank area to tapped for an new appointment on that hour.

Please help us to handle this situations.

Yana
Telerik team
 answered on 20 Jun 2019
4 answers
371 views

Using the following;

<telerikDataControls:RadTreeView
    x:Name="treeView"
    Grid.Row="1"
    Grid.Column="0"
    Grid.ColumnSpan="3" 
    ItemsSource="{Binding RunList}">
    <telerikDataControls:TreeViewDescriptor
        DisplayMemberPath="RunStart"
        TargetType="{x:Type viewModels:DriverRunVm}"
        ItemsSourcePath="Jobs">
    </telerikDataControls:TreeViewDescriptor>
     
    <telerikDataControls:TreeViewDescriptor DisplayMemberPath="JobLine1" TargetType="{x:Type viewModels:JobVm}"/>
</telerikDataControls:RadTreeView>

 

The treeview displays the "RunStart" value in the header followed by the list of Jobs.  If I change this to;

<telerikDataControls:RadTreeView
    x:Name="treeView"
    Grid.Row="1"
    Grid.Column="0"
    Grid.ColumnSpan="3" 
    ItemsSource="{Binding RunList}">
    <telerikDataControls:TreeViewDescriptor
        DisplayMemberPath="RunStart"
        TargetType="{x:Type viewModels:DriverRunVm}"
        ItemsSourcePath="Jobs"
        ItemTemplate="{StaticResource RunHeaderTemplate}">
    </telerikDataControls:TreeViewDescriptor>
     
    <telerikDataControls:TreeViewDescriptor DisplayMemberPath="JobLine1" TargetType="{x:Type viewModels:JobVm}"/>
</telerikDataControls:RadTreeView>

 

And use this template;

<ContentPage.Resources>
    <ResourceDictionary>
        <DataTemplate x:Key="RunHeaderTemplate">
            <Grid
                BackgroundColor="#ffb999"
                RowSpacing="0"
                Padding="5,2,5,0"
                Margin="0">
 
                <Grid.RowDefinitions>
                    <RowDefinition Height="auto" />
                    <RowDefinition Height="auto" />
                </Grid.RowDefinitions>
 
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="auto" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
 
                <Label
                    Grid.Row="0"
                    Grid.Column="0"
                    Text="Start:"
                    TextColor="{StaticResource DarkSlateGrey}"
                    FontSize="17"
                    Margin="0"
                    HorizontalOptions="End"
                    VerticalOptions="CenterAndExpand"/>
 
                <Label
                    Grid.Row="0"
                    Grid.Column="1"
                    Text="{Binding RunStart}"
                    TextColor="{StaticResource DarkSlateGrey}"
                    FontSize="17"
                    Margin="0"
                    HorizontalOptions="Start"
                    VerticalOptions="CenterAndExpand"/>
            </Grid>
        </DataTemplate>
    </ResourceDictionary>
</ContentPage.Resources>

 

The label "Start:" is displayed however the error "[0:] Binding: 'RunStart' property not found on 'Telerik.XamarinForms.DataControls.TreeView.TreeViewDataItem', target property: 'Xamarin.Forms.Label.Text'" is reported.

I have tried using "treeView:ItemText" instead of a label but I get the same error.  So I don't understand how the "DisplayMemberPath" displays the start value correctly but the same property in the template doesn't work.

Yana
Telerik team
 answered on 20 Jun 2019
11 answers
370 views
How can I execute a job if the cell is being tapped twice? I can not find examples...
Lance | Senior Manager Technical Support
Telerik team
 answered on 19 Jun 2019
4 answers
710 views

I am just starting with the Telerik Xamarin controls and the documentation uses a single observable collection to display and group data in the listview control.  My application uses an observable collection containing the data for a driver's itinerary for multiple days which in turn contain an observable collection of jobs for each day.

Is it possible to bind the group headers to the "runs" collection and the item template to the "jobs" collection?

Raymond
Top achievements
Rank 1
 answered on 18 Jun 2019
2 answers
145 views

We are using the RadListView and have added a Picker ontrol.

When the user selects an item in the Picker, the RadListView's ItemTemplateSelector fires and reloads the cell, loosing the values.

How can we stop the ItemTemplateSelector from firing when a picker is selected?

 

<dataControls:RadListView
x:Name="list"
IsVisible="{Binding IsLoading, Converter={StaticResource NegateBooleanConverter}}"
ItemsSource="{Binding Items}"
BackgroundColor="White"
IsPullToRefreshActive="{Binding IsBusy}"
IsPullToRefreshEnabled="True"
                SelectionMode="None">
 
<dataControls:RadListView.ItemTemplateSelector>

Lance | Senior Manager Technical Support
Telerik team
 answered on 18 Jun 2019
3 answers
469 views

Hi All,

 

 I have a data grid that is bound via itemSource my quesiton is the following how does one  color a row based on a column value I would need in this example if TotalQty is less than Quantity to have it an amber color then green once they are equal. Also how does one change the font colour as well.

 

01.<telerikGrid:RadDataGrid x:Name="gridItemsBoms"   IsVisible="False" SelectionMode="Single"  SelectionChanged="GridItems_SelectionChanged"   AutoGenerateColumns="False" >
02.    <telerikGrid:RadDataGrid.Columns>
03.        <telerikGrid:DataGridTextColumn PropertyName="SequenceNumber"  HeaderText="Sequence" />
04.        <telerikGrid:DataGridTextColumn PropertyName="TotalQty" HeaderText="Pick Qauntity" />
05. 
06.        <telerikGrid:DataGridTextColumn PropertyName="Quantity" HeaderText="Quantity" />
07.         <telerikGrid:DataGridTextColumn PropertyName="Description" HeaderText="Name"  />
08.        <telerikGrid:DataGridTextColumn PropertyName="UnitOfMeasure"  HeaderText="UnitOfMeasure" />
09.         
10.     
11.    </telerikGrid:RadDataGrid.Columns>
12.</telerikGrid:RadDataGrid>
Lance | Senior Manager Technical Support
Telerik team
 answered on 18 Jun 2019
7 answers
918 views

Hi,

I'm trying to add a button to a RadListView cell. The ListView cell has an ItemTapped event handler, which works as expected. But when I add a button to the template cell, the button's click handler is never called. 

XAML:

<telerikDataControls:RadListView x:Name="listView" ItemsSource="{Binding ListSource, Mode=TwoWay}" SelectionMode="Single"  ItemTapped="List_Tapped">
    <telerikDataControls:RadListView.ItemTemplate>
        <DataTemplate>
            <telerikListView:ListViewTemplateCell>
                <telerikListView:ListViewTemplateCell.View>
 
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="2*" />
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>
 
                        <Label Margin="10" Text="{Binding itemName}" Grid.Row="0" Grid.Column="0" />
 
                        <Button Text="Button" BackgroundColor="Blue" Clicked="Button_Clicked" Grid.Row="0" Grid.Column="1" Margin="0,0,30,0" HorizontalOptions="EndAndExpand" VerticalOptions="Center" />
                    </Grid>
                </telerikListView:ListViewTemplateCell.View>
            </telerikListView:ListViewTemplateCell>
        </DataTemplate>
    </telerikDataControls:RadListView.ItemTemplate>
</telerikDataControls:RadListView>

 

Code Behind:

private void List_Tapped(object sender, Telerik.XamarinForms.DataControls.ListView.ItemTapEventArgs e)
{
    Debug.WriteLine("List item tapped");
}  
 
private void Button_Clicked(object sender, EventArgs e)
{
    Debug.WriteLine("Button clicked");
    DisplayAlert("Alert", "Button was clicked", "OK");
}

 

I'm assuming that the ListView ItemTapped event is overridding the button's click handler, but how can I make this work?

 

Thanks in advance!

 

 

Stefan Nenchev
Telerik team
 answered on 18 Jun 2019
1 answer
99 views

Hello all together,

I'm using the RadCartesian chart with BarSeries on Samsung Galaxy Tab with Android (9.0) and iPad with iOS (12.1) and Telerik UI for Xamarin (v2019.1.318.1). On Android the chart looks very stylish, on iOS not. On iOS the bars are not centered, thinner than on Android and the labels don't look good. How can I archive the Android look on iOS? I'm not using Telerik themes for styling.

 

Please have a look at "Android_chart.png" and "iOS_chart.png". The arrows 1. / 2. / 3. in iOS png show to not centered bars and the labels.

 

Kind regards,

Martin

Yana
Telerik team
 answered on 17 Jun 2019
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?