Quantcast
Channel: VBForums - WPF, WCF, WF
Viewing all articles
Browse latest Browse all 256

How to insert image near text in wpf DataGrid c#

$
0
0
I made a code that populate a DataGrid. All working good, but now I want add near the field "name" an image. The link of this image is grabbed by a database. The image is on svg format, for this I'm using the resource svg2xaml.

This line of code return the image:

Code:

SvgReader.Load(new MemoryStream(new System.Net.WebClient().DownloadData(reader["crestUrl"].ToString())));
I use this code for populating the DataGrid:

Code:

MainWindow.AppWindow.Squadre_DataGrid.Items.Add(new Teams.Club_Information
{
        name = reader["name"].ToString()
}

This is my xaml structure:

Code:

<DataGrid>
        <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding Path = 'name'}" ClipboardContentBinding="{x:Null}" Header="Codice" Width="*" />
...

How can I add this image through code?

Viewing all articles
Browse latest Browse all 256

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>