ComboBox + MaskedTextBox = Fatal Error

3 posts, 0 answers
  1. Tweel
    Tweel avatar
    7 posts
    Member since:
    Feb 2010

    Posted 17 Mar 2010 Link to this post

    When using a Dataform to edit a collection, having both a RadComboBox and RadMaskedTextBox on that form will cause a fatal application error. This occurs even using a simple non-hierarchical base type with only strings. Having either control by themselves, works fine.

    My other problem with RadComboBox is that it does not respect the read-only state of the dataform, like RadMaskedTextBox does.

    Can anybody help me to use the standard DataForm with these controls?

    Page XAML:
                     <dataFormToolkit:DataForm.EditTemplate> 
                            <DataTemplate> 
                                <StackPanel> 
                                    <dataFormToolkit:DataField> 
                                        <telerikInput:RadMaskedTextBox MaskType="None" Value="{Binding Name, Mode=TwoWay}"/> 
                                    </dataFormToolkit:DataField> 
                                    <dataFormToolkit:DataField> 
                                        <telerikComboBox:RadComboBox SelectedValue="{Binding Gender, Mode=TwoWay}" SelectedValuePath="Content"
                                            <telerikComboBox:RadComboBoxItem Content="Male" /> 
                                            <telerikComboBox:RadComboBoxItem Content="Female" /> 
                                        </telerikComboBox:RadComboBox> 
                                    </dataFormToolkit:DataField> 
                                </StackPanel> 
                            </DataTemplate> 
                        </dataFormToolkit:DataForm.EditTemplate> 
                    </dataFormToolkit:DataForm> 
     

     
    Page Contructor:
                DataSet = new People(); 
                this.ElemForm.ItemsSource = DataSet; 


    Class People:
        public class People : ObservableCollection<Person> 
        { 
            public People() 
            { 
                Person John = new Person("John""Male"); 
                Add(John); 
                Add(new Person("Sue""Female")); 
            } 
        } 
     
     

    Class Person:
        public class Person 
        { 
            public string Name { getset; } 
            public string Gender { getset; } 
     
            public Person() 
            { 
                this.Name = ""
                this.Gender = ""
            } 
            public Person(string name, string gender) 
            { 
                this.Name = name; 
                this.Gender = gender; 
            } 
        } 


  2. Tweel
    Tweel avatar
    7 posts
    Member since:
    Feb 2010

    Posted 22 Mar 2010 Link to this post

    Hi,

    In case anyone cares,

    My fatal error was caused by using telerikComboBox:RadComboBoxItem instead of telerikInput:RadComboBoxItem in the XAML to declare the list options. Took a lot of time for me to track down, cos the wrong code looked right.
  3. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 23 Mar 2010 Link to this post

    Hello Tweel,

    We are glad that you have resolved the issue by yourself.

    If you have any other questions about our controls please feel free to contact us again.

    All the best,
    Konstantina
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top