Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
540
xamComboEditor displays string lengths, not string values
posted

Just starting with wpf. Trying to figure out what I did wrong. 

I have the following xaml ... 

        <ig:XamComboEditor

            Name ="cbeElementList"

            SelectionChanged="cbeElementList_OnSelectionChanged"

            IsEditable="False"

            Height="30" Width="250"   

            MaxDropDownHeight="150"

            Margin="52,48,215,241"/> 

Its ItemsSource comes from a List of enum GetNames entries. 

        public static List<string> GetElmentFieldList(string elementType = "ElementType")

        {

            var eType = "Sunlight.Json.e" + elementType;

            var myType = Type.GetType(eType);

            return Enum.GetNames(myType).ToList();

        } 

The combo is loaded as follows…

private void LoadDataEntitiesList()

        {

            var dataEntities = SunlightFields.GetElmentFieldList("ElementType");

            cbeElementList.ItemsSource = dataEntities;

            cbeElementList.SelectedIndex = 0;

        } 

When the editor displays, instead of the string values (alpha, beta, gamma) being listed, their lengths are listed (5,4,5). 

When I retrieve the selected item, the return string is the actual string value (alpha) …

var name = cbeElementList.SelectedItem.ToString(); 

The xaml namespaces are … 

        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

        xmlns:ig="http://schemas.infragistics.com/xaml"

        x:Class="SmartC.Wpf.MainWindow"

        Title="MainWindow" Height="350" Width="525"> 

Trying to figure out what I have done wrong. 

Thanks - Abbott

Parents Reply Children
No Data