Make entire card clickable

On this page it says

"The entire Card UI can be set up as a clickable action item"

I can't figure out how to do that though.

1 Reply 1 reply marked as answer

RV Ravikumar Venkatesan Syncfusion Team September 14, 2020 11:00 AM UTC

Hi Benjamin, 

Greetings from Syncfusion support. 

We have validated your requirement at our end. We have achieved your requirement with the help of the below code. We have prepared a sample for your reference and it can be available below. 

[Index.razor] 
@using Syncfusion.Blazor.Cards 
 
<SfCard ID="BasicCard" @onclick="OnClick"> 
    <CardHeader Title="@Title" /> 
    <CardContent Content="@Content" /> 
</SfCard> 
 
@code{ 
    bool Clicked = false; 
    public string Title { get; set; } = "Debunking Five Data Science Myths"; 
    public string TempTitle { get; set; } = "Debunking Five Data Science Myths"; 
    public string Content { get; set; } = "Tech evangelists are currently pounding their pulpits about all things AI, machine learning, analytics—anything that sounds"; 
    public string TempContent { get; set; } = "Tech evangelists are currently pounding their pulpits about all things AI, machine learning, analytics—anything that sounds"; 
    void OnClick() 
    { 
        Clicked = !Clicked; 
        if(Clicked) 
        { 
            Title = "Test title"; 
            Content = "Test Content"; 
        } else 
        { 
            Title = TempTitle; 
           Content = TempContent; 
        } 
    } 


Kindly try the above sample and get back to us if you need any further assistance. 

Regards, 
Ravikumar Venkatesan 


Marked as answer
Loader.
Up arrow icon