locked
Styling a button in a datagrid- can't find it in Blend. RRS feed

  • Question

  • I used VS 2008 to create a simple datagrid (WPF toolkit).   To the data grid I added two template columns which I configured as buttons.   I created the buttons by adding XAML code to the project directly.

    I now want to use Expression Blend to edit the appearance of the buttons.   I opened the project in Blend and can see the Datagrid.  However I cannot see the buttons or any reference to them other than in the XAML (below).

    How can I 'see' the buttons so that I can edit their appearance?

    Thanks.

    Steve

    <Grid>
        	<Grid.ColumnDefinitions>
        		<ColumnDefinition Width="0.49*"/>
        		<ColumnDefinition Width="0.51*"/>
        	</Grid.ColumnDefinitions>
            <my:DataGrid Margin="0,90,0,0" Name="DataGridResults" AutoGenerateColumns="False" Background="#FF79E382" Grid.ColumnSpan="2">
                <my:DataGrid.Columns>
                    <my:DataGridTemplateColumn Header="Buy">
                        <my:DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <Button Content="OFF" Click="Button_Click_Buy"/>
                            </DataTemplate>
                        </my:DataGridTemplateColumn.CellTemplate>
                    </my:DataGridTemplateColumn>
                    <my:DataGridTemplateColumn Header="Sell">
                        <my:DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <Button Content="OFF" Click="Button_Click_Sell"/>
                            </DataTemplate>
                        </my:DataGridTemplateColumn.CellTemplate>
                    </my:DataGridTemplateColumn>
                    <my:DataGridTextColumn
                        Width="100"
                        Header="Symbol"
                        IsReadOnly="True"
                        Binding="{Binding Path=LevelsAndSignals.Symbol, Mode=OneWay}"/>
                    <my:DataGridTextColumn
                        Width="100"
                        Header="EnvelopeLow"
                        IsReadOnly="True"
                        Binding="{Binding Path=LevelsAndSignals.EnvelopeLow, Mode=OneWay, StringFormat=F3}"/>
                    <my:DataGridTextColumn
                        Width="100"
                        Header="MovingAverage"
                        IsReadOnly="True"
                        Binding="{Binding Path=LevelsAndSignals.MovingAverage, Mode=OneWay, StringFormat=F3}"/>
                     <my:DataGridTextColumn
                        Width="100"
                        Header="EnvelopeHigh"
                        IsReadOnly="True"
                        Binding="{Binding Path=LevelsAndSignals.EnvelopeHigh, Mode=OneWay, StringFormat=F3}"/>  
                    
               </my:DataGrid.Columns>
            </my:DataGrid>
        </Grid>

    Wednesday, April 15, 2009 1:57 PM

All replies

  • Which version of Blend are you using? Blend 3 Preview is the first version of Blend that adds support for DataGrid (previous versions of Blend did not have support for the same).

    Also, there is a known crashing issue that you might run into if you were do a certain specific scenario in the current Blend 3 Preview, but mostly, things should work fine. We will fix this for the next release.

    Thanks,
    Unni
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Wednesday, April 15, 2009 11:20 PM