Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > DataForm > DataFormComboBoxField loses the selected value in edit mode

Not answered DataFormComboBoxField loses the selected value in edit mode

Feed from this thread
  • Matteo Gugliotta avatar

    Posted on Apr 20, 2012 (permalink)

    Hi, 
    I have a problem with a DataFormComboBoxField generated in code behind as suggested by your example

    Here is the code for generate the field
    e.DataField = GetComboField(columnFieldProp, e.DataField.DataMemberBinding);
    e.DataField.Loaded += delegate(object o, RoutedEventArgs eventArgs)
    {
          var field = o as DataFormComboBoxField;
          foreach (RadComboBox child in field.ChildrenOfType<RadComboBox>())
           {
                var comboBox = child;
                if (comboBox != null)
               comboBox.SetBinding(RadComboBox.SelectedValueProperty, e.DataField.DataMemberBinding);
           }
    };



    private DataFormComboBoxField GetComboField(ToolColumnFieldProp columnFieldProp, Binding dataBinding)
            {
                DataFormComboBoxField combo = new DataFormComboBoxField();
                combo.SelectedValuePath = columnFieldProp.ComboBoxSelectedPath;
                combo.DisplayMemberPath = columnFieldProp.ComboBoxDisplayPath;           
                object context = Code.Utility.CreateInstance(columnFieldProp.ComboBoxAssemblyName, columnFieldProp.ComboBoxContextNameSpace);
                combo.ItemsSource = Code.Utility.GetComboBoxItemSource(context);          
                combo.DataMemberBinding = dataBinding;          
                return combo;
            }

    XAML
    <telerik:RadDataForm x:Name="rdDataForm"  Header="{Binding Title}" CurrentItem="{Binding Current, Mode=TwoWay}" telerik:StyleManager.Theme="Office_Blue"
                        ItemsSource="{Binding List, Mode=TwoWay}" AutoGeneratingField="rdDataForm_AutoGeneratingField"   Grid.Row="0" AutoCommit="False"
                          EditEnded="rdDataForm_EditEnded" DeletedItem="rdDataForm_DeletedItem"  CommandButtonsVisibility="Cancel,Commit" LabelPosition="Beside"
                         >
         
    </telerik:RadDataForm>

    The ComboBoxField is correctly generated, and correctly bound to selected value. 
    The problem is that when i go in edit mode, the combobox loses the selected value.

    I have the same identical problem in the GridView that is bound to same collection.

    Could you please help me?

    Best regards

    Reply

  • Maya Maya admin's avatar

    Posted on Apr 20, 2012 (permalink)

    Hello Matteo,

    I have tried to reproduce the issue, but since I do not have all the necessary code, I was not able to get close to the scenario you described. Will it be possible to share a bit more code-snippets so that I could test it on my side ?
    On the other hand, why do you need to work with the RadComboBox inside DataFormComboBoxField ? Why not using directly the field ?  

    Regards,
    Maya
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

    Reply

  • Matteo Gugliotta avatar

    Posted on Apr 20, 2012 (permalink)

    Hi Maya,

    I can try to send you maybe via e-mail a little project, but it is part of a big and complicated project. Anyway if you need i will try to reproduce it.

    Anyway, i'm not using rad combobox, but i have just created a DataFormComboBoxField  

    Reply

  • Maya Maya admin's avatar

    Posted on Apr 20, 2012 (permalink)

    Hello Matteo,

    I am attaching a sample project here with a RadDataForm and a DataFormComboBoxField. Could you reproduce the same behavior on it by implementing your own custom code ?  

    Kind regards,
    Maya
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

    Reply

  • Matteo Gugliotta avatar

    Posted on Apr 20, 2012 (permalink)

    HI Maya,

    I have downloaded your project and i see that you are using the property dataField.IsComboboxEditable = true;

    However, i do not have this property available in my version of silverlight control RadControls for Silverlight, v.2012.1.326.1050
    your version is 1.4....

    I am not able to download from your site this internal build.

    Where i can find the download link?
    (i do no want to use automatically upgrade from inside vs2010)

    best regards

    Reply

  • Maya Maya admin's avatar

    Posted on Apr 20, 2012 (permalink)

    Hi Matteo,

    Indeed, we have included such a property in order to meet our customers' feature requests. 'IsComboboxEditable' property in contained in our internal builds. You can download them in your Telerik account.


    Kind regards,
    Maya
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

    Reply

  • Matteo Gugliotta avatar

    Posted on Apr 20, 2012 (permalink)

    Hi Maya,

    Thanks, it does not solve my issue but anyway upgrade controls to last version :-)

    I will try to create a test project and then back to you

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > DataForm > DataFormComboBoxField loses the selected value in edit mode