Picture in Grid collumn

Good Morning, 

I'm new in Blazor and trying to put picture in my Grid


my picture is in the directory

wwwroot/assets/Clientes


Name Cli2.jpg


and getting the Id of the client from Class ClienteMD.Id


Using this code


    <GridColumn HeaderText="Foto" TextAlign="Syncfusion.Blazor.Grids.TextAlign.Center" Width="120">

                    <Template>


                        @{

                            var cliente = (context as ClienteMD);

                            <div class="image">

                                <img src="@("assets/Clientes/Cli{ClienteMD.Id}.jpg")" alt="@("assets/Clientes/semfoto.jpg")" />

                            </div>

                        }

                    </Template>

                </GridColumn>


Can U Help ?



3 Replies

RS Renjith Singh Rajendran Syncfusion Team November 22, 2021 10:59 AM UTC

Hi Renato, 
 
Greetings from Syncfusion support. 
 
We have already documented this topic in our online documentations. We suggest you to refer the below documentations for more details regarding this. 
 
Please refer the below highlighted codes, 
 
 
<GridColumn HeaderText="Foto" TextAlign="Syncfusion.Blazor.Grids.TextAlign.Center" Width="120"> 
    <Template> 
        @{ 
            var cliente = (context as Order); 
            <div class="image"> 
                <img src="@($"Images/Uploads/{cliente.RollNo}.png")" ... />
            </div> 
        } 
    </Template> 
</GridColumn> 
 
 
We have also prepared a sample for your convenience, 
 
Please get back to us if you need further assistance. 
 
Regards, 
Renjith R 



RE Renato November 22, 2021 01:51 PM UTC

Tks for your Reply,

 I will study the sample 


Tks, Renato Fabiao



RS Renjith Singh Rajendran Syncfusion Team November 23, 2021 09:45 AM UTC

Hi Renato, 
 
Thanks for your update. Please get back to us if you need further assistance. 
 
Regards, 
Renjith R 


Loader.
Up arrow icon