• Advertisement
Sign in to follow this  

[.net] How do I add an image to a dataset?

This topic is 2387 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How do I add an image to a dataset?

This is a C#/Silverlight question although I am trying to emulate what I see in Excel.

In the screen snapsot below, there is an excel file that has little arrow indicators inside the cells of one column. First of all, I do not know how even this can be done. For starters, that would be a good thing to learn. But I need to emulate this in a C# / Silverlight app. How would I put little graphics like this into a dataset/datagrid?


Data_Arrows.jpg

Share this post


Link to post
Share on other sites
Advertisement
In WPF/Silverlight you usually define a template to customize a control visual.For exemple a simple template to show an image and some text.



<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Image Grid.Column="0" Source="../Images/MyImage.png"/>
<TextBlock Grid.Column="1" Text="{Binding MyValue}"/>
</Grid>
</DataTemplate>

Then you could use that template as a CellTemplate in your DataGrid.


Some materials you may want to read on this topics :

(MSDN) Control Customization

WPF Tutorial

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement