We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Kanban card shadow

Thread ID:

Created:

Updated:

Platform:

Replies:

143447 Mar 20,2019 01:02 PM UTC Mar 22,2019 10:16 AM UTC Xamarin.Forms 1
loading
Tags: SfKanban
Artur Aksamit
Asked On March 20, 2019 01:02 PM UTC

Is it possible to remove frame (or at least border and shadow) from card? I want to use custom frame with corner radius and no shadow.

Bharathiraja K [Syncfusion]
Replied On March 22, 2019 10:16 AM UTC

Hi Artur, 
 
Greeting from Syncfusion, 
 
Yes, it is possible to remove border and shadow by replacing the default card template with your own design using SfKanban.CardTemplate, please find the code snippet below. 
 
Code Snippet [XAML]: 
<kanban:SfKanban.CardTemplate> 
                <DataTemplate> 
                   <Frame  WidthRequest="250"  Padding="0"  CornerRadius="8" HasShadow="False" > 
                        <StackLayout Padding="10" Orientation="Vertical"> 
                            <StackLayout  Orientation="Horizontal"> 
                        <Label Text="{Binding Path=Title}" TextColor="Black" HorizontalOptions="StartAndExpand" > 
                        </Label> 
                    </StackLayout> 
                    <StackLayout  Orientation="Horizontal"> 
                        <Label Text="{Binding Description}" WidthRequest="150" FontSize="14" TextColor="Silver" LineBreakMode="WordWrap" ></Label> 
                        <Image Source="{Binding ImageURL}" HeightRequest="50" WidthRequest="50"  ></Image> 
                    </StackLayout> 
                        </StackLayout> 
                    </Frame> 
                </DataTemplate> 
</kanban:SfKanban.CardTemplate> 
 
Need to follow two more step to remove border in android. 
 
Create class inherited from SfKanbanAdaptorHelper under Android project. Override BindItemView and set transparent color for ITemView. 
[C#] 
    
namespace SampleKanban.Droid 
{ 
public class CustomKanbanAdapter : KanbanAdapterHelper 
    { 
        public CustomKanbanAdapter(Syncfusion.SfKanban.Android.SfKanban kanban, Syncfusion.SfKanban.XForms.SfKanban fkanban) : base(kanban, fkanban) 
        { 
        } 
 
        protected override void BindItemView(Native.KanbanColumn column, Native.KanbanItemViewHolder viewHolder, object data, int position) 
        { 
            base.BindItemView(column, viewHolder, data, position); 
            viewHolder.ItemView.SetBackgroundColor(Android.Graphics.Color.Transparent); 
        } 
    } 
} 
} 
 
Create instance for helper class under form view initializer. 
 
[C#] Class: MainActivity.CS 
. . .         
 protected override void OnCreate(Bundle savedInstanceState) 
        { 
            base.OnCreate(savedInstanceState); 
. . . 
            Xamarin.Forms.Forms.ViewInitialized += Forms_ViewInitialized; 
. . . 
            LoadApplication(new App()); 
        } 
. . .  
 
private void Forms_ViewInitialized(object sender, ViewInitializedEventArgs e) 
    { 
            var nativeKanban = e.NativeView as Native.SfKanban; 
            var FormsKanban = e.View as SfKanban; 
 
            if (nativeKanban != null && FormsKanban != null) 
            { 
                nativeKanban.Adapter = new CustomKanbanAdapter(nativeKanban, FormsKanban); 
            } 
    } 
 
 
We have prepared simple sample for this requirement that can be downloaded from below location.  
 
 
Regards, 
Bharathi. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;