syncfusion / blazor-samples

Explore and learn Syncfusion Blazor components using large collection of demos, example applications and tutorial samples
https://blazor.syncfusion.com/
295 stars 151 forks source link

SfGrid + third-party icons incompatibility #158

Closed thepra closed 11 months ago

thepra commented 1 year ago

From the documentation I've found no other way to replace those default icons that right now are displayed as such: immagine

with a custom template for the pagination... do I really need to write the whole pagination template in order to just have my third party icons working?(they are from fontawesome in this case)

VigneshNatarajan27 commented 11 months ago

Query: “do I really need to write the whole pagination template in order to just have my third party icons working?(they are from fontawesome in this case)”

As per your requirement we have achieved your requirement of displaying the font awesome icons by applying the CSS styles using the class name used in that buttons. Refer to the below code example.

<style>
    .e-pager .e-icon-first::before{
        content: "\f0a8";
        font-family: "Font Awesome 5 Free";
        font-weight: 900;
    } 

    .e-pager .e-icon-last::before{

        content: "\f0a9";
        font-family: "Font Awesome 5 Free";
        font-weight: 900;
    }

    .e-pager .e-icon-prev::before {
        content: "\f137";
        font-family: "Font Awesome 5 Free";
        font-weight: 900;
    }

    .e-pager .e-icon-next::before {
        content: "\f138";
        font-family: "Font Awesome 5 Free";
        font-weight: 900;
    }

</style>

Without using pager template icons can be modified using the CSS styles only. Class name cannot be added to existing pager button. So to apply font awesome icons, we suggest you to styles applied to class name (fas fa-chevron-circle) to default grid class name as specified above.

Sample: https://blazorplayground.syncfusion.com/rtrgishqKagFCqPk

Please get back to us if you have further queries.

thepra commented 11 months ago

Should work, thanks.