This project has moved. For the latest updates, please go here.

CellContentTemplate and bindind not working

May 10, 2014 at 2:15 AM
Edited May 10, 2014 at 8:05 AM
hi, i have some questions :

1) is the FieldName property required for the Column ?

2) what the difference between Column and UnboundColumn

3) the databinding seems to have no effect inside CellContentTemplate
  <xcdg:Column Width="90" FieldName="ID_ADHERANT"  >
                        <xcdg:Column.CellContentTemplate>
                            
                            <DataTemplate>

                                <TextBlock Width="90" Height="25" Text="{Binding ID_ADHERANT}"/>
                            </DataTemplate>
                        </xcdg:Column.CellContentTemplate>
                    </xcdg:Column>
i have checked that i don't have databinding errore in VS debugger


i need this templated column to some stuff and controls(progressbars/buttons... etc) and not only a single value
thanks and good day
Developer
May 21, 2014 at 12:35 PM
Hi,

You can find the doc for the complete Xceed WPF DataGrid here : http://xceed.com/pages/TopMenu/Support/DocumentationCenter.aspx?Lang=EN-CA

1) Yes the FieldName is required to identify the column you want to define in the DataGrid. It uniquely identifies the column in a grid's column collection.

2) A column is a regular colum that is displayed in the PropertyGrid. It defines information on how the cells they contain are displayed and their content edited.
An unbound column is a column that can be used to display non-data related information such as a label or controls that allow some sort of action to be carried out (e.g., a button to open a window in which the current item can be edited). Unlike data bound columns, unbound columns cannot be grouped or sorted, nor can their values be filtered.

3) Try removing the "ID_ADHERANT" in the Binding.
Here's an example :
<xcdg:Column Width="90"
                         FieldName="ID_ADHERANT">
               <xcdg:Column.CellContentTemplate>
                  <DataTemplate>
                     <TextBlock Width="90"
                                Height="25"
                                Background="Green"
                                Text="{Binding}" />
                  </DataTemplate>
               </xcdg:Column.CellContentTemplate>
 </xcdg:Column>