Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > DataForm > DataFormComboBoxField issues

Not answered DataFormComboBoxField issues

Feed from this thread
  • steve avatar

    Posted on Nov 29, 2011 (permalink)

    Hello Telerik Forum!

    I am having some strange issues with the DataFormComboBoxField.

    <telerik:DataFormComboBoxField Grid.Row="2" Grid.Column="1" 
                                                           SelectedValuePath="CategorieId" DisplayMemberPath="Categorie"
                                                           ItemsSource="{Binding Categories, Source={StaticResource TEST}}"
                                                           DataMemberBinding="{Binding CategorieId, Mode=TwoWay}" />

    Me.Personen = New ObservableCollection(Of Personen)()
    Me
    .Categories = New ObservableCollection(Of PersoonCategorie)


    My model is in attachement.

    The datacontext of my view is Personen, and a statis resource 'TEST' for Categories

    When i edit my form, the combobox loads correctly, also, when i change the value, it makes the changes in my RadGrid also properly.
    However, once i end edit mode, and try to save, it gives me a NULL field.

    So for some reason, the categorieId field DOES change (visible in my grid), but it makes itself go NULL value.

    Any help on this please? I am in a hury to finish this project.

    Thank you very much!
    Attached files

    Reply

  • Ivan Ivanov Ivan Ivanov admin's avatar

    Posted on Dec 2, 2011 (permalink)

    Hi Steve,

    Please, excuse me for the late reply. I have tried to reproduce the described issue, testing it with our latest official version, but unfortunately without having any success. I am attaching my project for your reference. Would you please confirm whether I am not missing something? What exactly do you mean by saying: "However, once i end edit mode, and try to save, it gives me a NULL field."?  Meanwhile, a running sample project that illustrates this problem would be highly appreciated, or at least some more info on your scenario.

    All the best,
    Ivan Ivanov
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

    Reply

  • Say Hello to Telerik's PivotGrid for ASP.NET AJAX, Silverlight, WPF and WinForms. Now packed with OLAP support.
  • Andreas avatar

    Posted on Feb 22, 2012 (permalink)

    Hello All!

    It seems if we understood correctly, we have the same issue with the DataFormComboBoxField:

    We bound it in this way:

                            <telerik:DataFormComboBoxField Grid.Column ="0" Grid.Row="4" Label="Dokumenttyp"  
                                 ItemsSource="{Binding Path=DataContext.DocumentTypes,Mode=TwoWay, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:RadDataForm}}}"
                                 DataMemberBinding="{Binding SelectedDocumentType, Mode=TwoWay}"
                                 DisplayMemberPath="Name"
                                 SelectedValuePath="Value">
                            </telerik:DataFormComboBoxField>
    
    We are able to select an Item in the ComboBox,
    The SelectedDocumentType field is filled correctly with the "Value"
    When pressing the "OK" Button immediate the bound property "SelectedDocumentType" is set to null...

    Are we missing somthing in the binding?

    Thanks!
    Andreas Eibegger

    Reply

  • Andreas avatar

    Posted on Feb 22, 2012 (permalink)

    Hello!

    after investigating a little bit more we found out that if we use different DataTemplates for the DataForm (For Readonly and Edit)
    then it does not work, if we use only one DataTemplate it works.

    BR!
    Andreas

    Reply

  • Ivan Ivanov Ivan Ivanov admin's avatar

    Posted on Feb 24, 2012 (permalink)

    Hi Andreas,

    Would you please send us a runnable project that reproduces this issue, so that we could debug it on our side and give you an appropriate solution?

    Regards,
    Ivan Ivanov
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>

    Reply

  • bbakermai avatar

    Posted on Apr 3, 2012 (permalink)

    I have the same issue trying to do this in an MVVM context. I am using a TextBox with a value converter in the ReadOnly mode template and a RadComboBox in the Edit/New template. Below is sample markup from the DataForm and its EditTemplate (the DataContext of the DataForm is the selected item from a RadDataGrid, and so the ItemsSource of the lookup data in the ComboBox must be connected to the parent DataContext, which is a ViewModel class). When I am editing and changing values, the value in the parent grid changes, but when I press either OK or Cancel from edit mode, the ComboBox's selected item's ValuePath returned to the grid's selected item is null, and so that column clears in the grid. The data source remains unaffected.

    Here's the form itself:

    <telerik:RadDataForm x:Name="radDataForm1" 
    CurrentItem
    ="{Binding SelectedItem, ElementName=gridViewChartOfAccounts, Mode=TwoWay}"
    Header
    ="{Binding SelectedItem.Name, ElementName=gridViewChartOfAccounts}"
    Background
    ="Transparent"
    AutoCommit
    ="False"
    AutoGenerateFields
    ="False"
    LabelPosition
    ="Beside"
    CommandButtonsVisibility
    ="All"
    UseLayoutRounding
    ="True"
    ReadOnlyTemplate
    ="{StaticResource GLFormTemplate}"
    EditTemplate
    ="{StaticResource GLEditTemplate}"
    NewItemTemplate
    ="{StaticResource GLEditTemplate}">

    And the DataFormComboBox from the Edit Template:

    <telerik:DataFormComboBoxField Grid.Column="0" Grid.Row="2" Label="Account Type:" 
    ItemsSource
    ="{Binding ElementName=ChartOfAccountsControl, Path=DataContext.GLAccountClasses}"                                 DisplayMemberPath="AccountType" SelectedValuePath="GLAccountClass_ID" 
    LabelPosition
    ="Above"                                DataMemberBinding="{Binding GLAccountClass_ID, Mode=TwoWay}"/>
    I'd also like to know how to set the CommandButtonsVisibility to a combination of enum values...

    Reply

  • Ivan Ivanov Ivan Ivanov admin's avatar

    Posted on Apr 4, 2012 (permalink)

    Hello Bob,

    As it would be very difficult for us to prepare a full-blown project only having a XAML snippet, I would kindly ask you to send us a runnable sample, which we would be able to test on our side. As for the CommandButtonsVisibility property, the DataFormCommandButtonsVisibility type is a flagged enum, so that you can perform bitwise operations on them, like introduced in this article.

    Regards,
    Ivan Ivanov
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>

    Reply

  • Rick Feuer avatar

    Posted on Jul 23, 2012 (permalink)

    There is definately a bug using the DataFormComboField. I am having the exact issue as described above. The gender field actually gets changed, but my grid value that it is bound to get assigned null.  If i use a dataformDataField in place, the problem does not exist. My field is a simple collection of strings. I am using the latest version of the wpf dll's

    <telerik:DataFormComboBoxField DataMemberBinding="{Binding Gender,Mode=TwoWay}"
    ItemsSource
    ="{StaticResource Genders}"
    Label
    ="Gender"
    IsEnabled
    ="True" />

    Reply

  • Vera Vera admin's avatar

    Posted on Jul 25, 2012 (permalink)

    Hi Rick,

     
    Unfortunately, we were not able to reproduce the reported problem using the details you provided. May I ask you to open a support ticket and to send a simple runnable project demonstrating the issue? Please take a look at this blog post for a reference on how to isolate it in a sample project.

    Thank you in advance.

    All the best,
    Vera
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

    Reply

  • Aleks avatar

    Posted on Sep 21, 2012 (permalink)

    I came across the same issue and ended up in this topic. Since I could not find a solution, I sent in a support ticket with a sample project.

    Ivan provided a solution that worked. I am posting it here for anyone else that comes across the same issue and can not find the solution. 

    <telerik:DataFormDataField Label="Role: ">
          <telerik:RadComboBox SelectedItem="{Binding Role}" ItemsSource="{Binding ItemList, Source={StaticResource RoleDAL}}"  DisplayMemberPath="Name" />
    </telerik:DataFormDataField>


    Sorry about grave digging...

    -Aleks

    Reply

  • Say Hello to Telerik's PivotGrid for ASP.NET AJAX, Silverlight, WPF and WinForms. Now packed with OLAP support.

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > DataForm > DataFormComboBoxField issues