Welcome to the Xceed Community | Help
Community Search  
More Search Options

Binding only works on one of two textbox columns

Sort Posts: Previous Next
  •  09-03-2009, 5:12 PM Post no. 23727

    Binding only works on one of two textbox columns

    The first textbox column for "GL Code" binds just fine and saves all edits.  The second doesn't "Deferred GL Code".  Does anyone know how to get the second to work like the first, or know a better way to do both?

    Thanks, Ben

    <wpfc:XceedGridExtended Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="3" Name="GLCodeGrid"

    ItemScrollingBehavior="Immediate" AutoCreateColumns="False" NavigationBehavior="RowOrCell"

    IsTextSearchEnabled="False" SelectionMode="Single" CellEditorDisplayConditions="CellIsCurrent,MouseOverCell,MouseOverRow"

    EditTriggers="ClickOnCurrentCell,BeginEditCommand,ActivationGesture">

    <wpfc:XceedGridExtended.Columns >

    <xcdg:Column Title="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}},Path=ObjectTypeDescription, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" FieldName="ObjectName" ReadOnly="True"/>

    <xcdg:Column Title="GL Code" FieldName="." ReadOnly="True">

    <xcdg:Column.CellContentTemplate>

    <DataTemplate>

    <TextBox Text="{Binding Path=GLCode, Mode=TwoWay}" Width="100"/>

    </DataTemplate>

    </xcdg:Column.CellContentTemplate>

    <xcdg:Column.CellEditor>

    <xcdg:CellEditor>

    <xcdg:CellEditor.EditTemplate>

    <DataTemplate>

    <TextBox Text="{xcdg:CellEditorBinding}" Width="100"/>

    </DataTemplate>

    </xcdg:CellEditor.EditTemplate>

    </xcdg:CellEditor>

    </xcdg:Column.CellEditor>

    </xcdg:Column>

    <xcdg:Column Title="Deferred GL Code" FieldName="DeferredGLCode" ReadOnly="True" >

    <xcdg:Column.CellContentTemplate>

    <DataTemplate>

    <TextBox Text="{Binding Path=., Mode=TwoWay}" Width="100"/>

    </DataTemplate>

    </xcdg:Column.CellContentTemplate>

    <xcdg:Column.CellEditor>

    <xcdg:CellEditor>

    <xcdg:CellEditor.EditTemplate>

    <DataTemplate>

    <TextBox Text="{xcdg:CellEditorBinding}" Width="100"/>

    </DataTemplate>

    </xcdg:CellEditor.EditTemplate>

    </xcdg:CellEditor>

    </xcdg:Column.CellEditor>

    </xcdg:Column>

    </wpfc:XceedGridExtended.Columns>

    <wpfc:XceedGridExtended.View >

    <xcdg:TableView ShowRowSelectorPane="False" >

    <xcdg:TableView.FixedFooters>

    <xcdg:ClearHeadersFooters/>

    <DataTemplate>

    <Grid>

    <Grid.ColumnDefinitions >

    <ColumnDefinition Width="Auto" />

    <ColumnDefinition Width="Auto" />

    </Grid.ColumnDefinitions>

    <TextBlock Grid.Column="0" VerticalAlignment="Bottom" Margin="1"># Records:</TextBlock>

    <TextBlock Grid.Column="1" Margin="1"

    Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}},Path=RecordCount, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" />

    </Grid>

    </DataTemplate>

    </xcdg:TableView.FixedFooters>

    </xcdg:TableView>

    </wpfc:XceedGridExtended.View>

    </wpfc:XceedGridExtended>

  •  09-03-2009, 5:32 PM Post no. 23729 in reply to 23727

    Re: Binding only works on one of two textbox columns

    you were not using your CellEditors because columns were read only and Dont use textboxes in CellContentTemplate use TextBlock

        <xcdg:Column Title="GL Code" FieldName="GLCode" Width="100">
            <xcdg:Column.CellContentTemplate>
                <DataTemplate>
                    <TextBlock Text="{Binding}"/>
                </DataTemplate>
            </xcdg:Column.CellContentTemplate>
            <xcdg:Column.CellEditor>
                <xcdg:CellEditor>
                    <xcdg:CellEditor.EditTemplate>
                        <DataTemplate>
                            <TextBox Text="{xcdg:CellEditorBinding}"/>
                        </DataTemplate>
                    </xcdg:CellEditor.EditTemplate>
                </xcdg:CellEditor>
            </xcdg:Column.CellEditor>
        </xcdg:Column>
        <xcdg:Column Title="Deferred GL Code" FieldName="DeferredGLCode" Width="100">
            <xcdg:Column.CellContentTemplate>
                <DataTemplate>
                    <TextBlock Text="{Binding}"/>
                </DataTemplate>
            </xcdg:Column.CellContentTemplate>
            <xcdg:Column.CellEditor>
                <xcdg:CellEditor>
                    <xcdg:CellEditor.EditTemplate>
                        <DataTemplate>
                            <TextBox Text="{xcdg:CellEditorBinding}"/>
                        </DataTemplate>
                    </xcdg:CellEditor.EditTemplate>
                </xcdg:CellEditor>
            </xcdg:Column.CellEditor>
        </xcdg:Column>

View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2011 Xceed Software Inc.