locked
DataGridTemplateColumn.CellTemplate question . RRS feed

  • Question

  • What's wrong with 'myconverter' if I want to set the cell background to a certain color within the datagrid? thank you, -hazz

    <data:DataGridTemplateColumn Header="Volume">
       <data:DataGridTemplateColumn.CellTemplate>
          <DataTemplate>
             <HyperlinkButton
                Content="{Binding GasVolume}"
                x:Name="color keyed numeric value"
                NavigateUri=" aspx page containing another datagrid"
                TargetName="_blank">
             </HyperlinkButton >
            <custom:myConverter Background="Binding GasVolume" />
           </DataTemplate>
        </data:DataGridTemplateColumn.CellTemplate>
    </data:DataGridTemplateColumn>

     
    Friday, January 9, 2009 9:23 AM

Answers

  • I think there two problems. First is definition of custom namespace. It should be as below:

    <UserControl .......
     xmlns:custom="clr-namespace:XTO_Silverlight_WCF_currentSummary"
    .... >
    
    Second is how u defined the resource. It should be defined as:
    <UserControl.Resource>
     <custom:IsGreaterThanConverter x:Key="myconverter" />
    </UserControl.Resource>
    
    Friday, January 9, 2009 1:45 PM

All replies