Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Showing a concrete value on WPF combobox?

$
0
0

After have populated one combo, I'd like to put a concrete value, after one assignation, how can I do that

1)Filling with items

 

        newClient = New clsClientes()

        For Each dr As DataRow In newClient.DevuelveTablasPaneles().Rows
            Me.DatosPanel1.Items.Add(dr.Item("DESCRIPCION").ToString.Trim)
        Next

2)Assignation of value:


Idea is simple, after loading my XML file and retrieved the correct key, I assign it to my Combobox:


Public xmlReader As New XmlTextReader(My.Application.Info.DirectoryPath & "\Paneles.xml")
 Public Reader As New XmlSerializer(GetType(PanelesXML))
 Public lector_configuracion As Object

   Try
            lector_configuracion = Reader.Deserialize(xmlReader)
   Catch
   End Try

   Me.DatosPanel1.SelectedValue = lector_configuracion.PanelValueCombo

But later, that value does not appears as the default value in my ComboBox.

What am I missing here?

Thanks for your help,




Primary platform is Windows 7 Ultimate 64 bit along with VS 2012/Sql2k8 for WPF/SilverLight projects.


Viewing all articles
Browse latest Browse all 18858

Trending Articles