Home Forums WPF controls Xceed DataGrid for WPF Combo not changing underlying data

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #25387 |

    Can someone please help me figure out what is going on. The combo shows up in the grid I can select a value, but when I leave the cell. The underlying data has not actually changed. I have also tryed it using a CellValuePresenter. The underlying object is a Linq To Sql class, generated in the Visual Studio 2008 beta2 Linq To Sql Designer. If I let it be the default editor I can change it.

    Code:
    <xcdg:CellEditor x:Key=”xMemberEditor”>
    <xcdg:CellEditor.EditTemplate>
    <DataTemplate>
    <ComboBox BorderThickness=”0″

    BorderBrush=”Transparent”
    Background=”Transparent”

    VerticalContentAlignment=”Top”
    SelectedValuePath=”Lme_id”
    ItemsSource=”{Binding Source={x:Static Application.Current},Path=Members}”
    DisplayMemberPath=”Lme_name”
    IsSynchronizedWithCurrentItem=”True”
    SelectedValue=”{xcdg:CellEditorBinding}”
    />
    </DataTemplate>
    </xcdg:CellEditor.EditTemplate>
    </xcdg:CellEditor>

    <xcdg:DataGridControl x:Name=”grid” AutoCreateColumns=”True”>

    <xcdg:DataGridControl.Columns>

    <xcdg:Column FieldName=”Cp_first_name” Title=”First Name” VisiblePosition=”0″/>
    <xcdg:Column FieldName=”Cp_last_name” Title=”Last Name” VisiblePosition=”1″/>
    <xcdg:Column FieldName=”Cp_training_number” Title=”Training Number” VisiblePosition=”2″/>
    <xcdg:Column FieldName=”Cp_id_number” Title=”Driver’s Lic.” VisiblePosition=”3″/>
    <xcdg:Column FieldName=”Cp_lme_id” Title=”Member” VisiblePosition=”4″ CellEditor=”{StaticResource xMemberEditor}” />
    <xcdg:Column FieldName=”Cp_co_id” Title=”County” VisiblePosition=”5″/>
    <xcdg:Column FieldName=”Cp_cost” Title=”Cost” VisiblePosition=”6″/>

    </xcdg:DataGridControl.Columns>

    </xcdg:DataGridControl>

    Imported from legacy forums. Posted by Jon (had 2903 views)

    User (Old forums)
    Member
    Post count: 23064

    I Bind to the Text Property not the SelectedValue
    It should work binding to Selected Value as long as your Source is not a Complex Object
    And do not use the CellEditorBinding
    IE
    ____________________________________________________________________

    Text=”{Binding RelativeSource={RelativeSource FindAncestor,
    AncestorType=xcdg:Cell},
    Path=ActualContent,
    UpdateSourceTrigger=PropertyChanged}”

    ___________________________________________________________________

    Imported from legacy forums. Posted by MiddleTommy (had 332 views)

    User (Old forums)
    Member
    Post count: 23064

    Did not fix the problem, the underlying data still did not change.

    Imported from legacy forums. Posted by Jon (had 299 views)

    User (Old forums)
    Member
    Post count: 23064

    One strange thing: why are you setting AutoCreateColumns to True, but then you give a list of columns?

    Perhaps you have two columns bound to the same field, and when data is updated, the automatic column overwrites the value updated previously by the other one.

    Imported from legacy forums. Posted by Andrés (had 4023 views)

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.