This is a migrated thread and some comments may be shown as answers.

ComboBox + MaskedTextBox = Fatal Error

2 Answers 30 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Tweel
Top achievements
Rank 1
Tweel asked on 18 Mar 2010, 02:15 AM
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 Answers, 1 is accepted

Sort by
0
Tweel
Top achievements
Rank 1
answered on 23 Mar 2010, 03:22 AM
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.
0
Konstantina
Telerik team
answered on 23 Mar 2010, 04:40 PM
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.
Tags
ComboBox
Asked by
Tweel
Top achievements
Rank 1
Answers by
Tweel
Top achievements
Rank 1
Konstantina
Telerik team
Share this question
or