This is a migrated thread and some comments may be shown as answers.
ItemSwipeContentTemplate add button
1 Answer 18 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Shalin asked on 18 Oct 2017, 01:39 PM


In radListview i enable swipe feature and implement ItemSwipeContentTemplate and add button to it.

When i swipe item app crashes, if i use Label it is not crashing. I am binding data template even in page xaml it crashes. my button is without image just text.

Is there any work arround to have Xamarin.Button with image and text on it ?

p.s. If i have button with image only it works, but output window error is there, but app is not crashing

Output window:

 [0:] FileImageSourceHandler: Could not find image or image file was invalid: File: 
An unhandled exception occured.


01.<DataTemplate x:Key="CommonItemSwipeTemplate">
02.               <Grid Margin="0"
03.                 Padding="0"
04.                 ColumnSpacing="0"
05.                 RowSpacing="0">
06.                   <Grid.ColumnDefinitions>
07.                       <ColumnDefinition Width="*" />
08.                       <ColumnDefinition Width="70" />
09.                   </Grid.ColumnDefinitions>
11.                   <Button Grid.Column="1"
12.                                BackgroundColor="Red"
13.                                HorizontalTextAlignment="Center"
14.                                Text="delete"                                
15.                                TextColor="White"
16.                                VerticalTextAlignment="Center"
17.                                WidthRequest="70" />
21.               </Grid>
22.           </DataTemplate>

1 Answer, 1 is accepted

Sort by
Lance | Manager Technical Support
Telerik team
answered on 18 Oct 2017, 03:18 PM
Hi Shalin,

That code you shared is not valid XAML. It looks like you just swapped out "Label" with "Button", but forgot to remove the properties that a Button does not have (e.g. the text alignments). You can test your Button XAML by first using it on the Page level, then once it works there use it for the ItemSwipeContentTemplate.

Tip: I strongly recommend turning on XamlC, this will catch XAML issues during compilation instead of crashing at run-time. See the Xamarin documentation here for how to enable XamlC.

Lance | Tech Support Engineer, Sr.
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Asked by
Top achievements
Rank 1
Answers by
Lance | Manager Technical Support
Telerik team
Share this question