Reply
Old October 6th, 2011 Top | #1
 
Complete's Avatar
OSNN Addict
Joined: August 2005
Posts: 94
Reputation: 10
Power: 83

Default Arrows in a XAML table

I want to put little arrows inside a DataGrid to mimic the kind of display shown in this Excel file:



But the XAML code defines individual columns instead of individual cells:
Code:
                    <data:DataGridTemplateColumn Header="Prev. Mo. Trend" IsReadOnly="True">
                        <data:DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <StackPanel>
                                    <Image x:Name="img1" Width="11"  Height="12"  VerticalAlignment="Center" HorizontalAlignment="Left" 
                                   Source="/MedAnalyzer;component/Assets/greenuparrow.png" Visibility="Visible"/>
                                    <TextBlock  VerticalAlignment="Center" HorizontalAlignment="Right"  x:Name="Prev_Mo_Trend" Text="{Binding Prev_Mo_Trend}">
                                    </TextBlock>
                                </StackPanel>
                            </DataTemplate>
                        </data:DataGridTemplateColumn.CellTemplate>
                    </data:DataGridTemplateColumn>
I can add text into the Datagrid by data binding with an observable collection. But this is text data. What about replacing gaphics? Do I need something extra special?

This is the results of my efforts



I do not need to have the graphic and the text share the same sell. That part can be overlooked. How can I just replace the arrow with a different error within the cell?
Complete is offline   Reply With Quote

Reply

Bookmarks

Thread Tools

Posting Rules

Similar Threads
Thread Thread Starter Forum Replies Last Post
How RowDefinition in XAML works? Complete Web Design & Coding 1 April 10th, 2012 7:32am
How do you make repeatable backgrounds for things in XAML? Complete Web Design & Coding 0 September 8th, 2011 6:57pm
Why Can't I see XAML in Design Mode? Complete Web Design & Coding 3 April 11th, 2011 6:27pm
How to get rid of shourcut arrows? wingman411 Windows Desktop Systems 2 August 3rd, 2003 1:01am
Shortcut arrows?? tinymonkey Windows Desktop Systems 18 November 17th, 2002 11:24pm