Jump to content

combobox - display System.Data.DataRowView

Recommended Posts


Bom dia :)

Ao efetuar clique na combo, os dados mostrados são:


Ao selecionar um, depois já fica o nome da pessoa.

o código que tenho no xaml.cs é:

 private void populatecombo()
		 Servicoteste.NivelCompClient wcfServiceClient = new Servicoteste.NivelCompClient();
		 DataSet datasettemp = wcfServiceClient.ConsultaPSPredominante();
		 CbboxPSPredominante1.ItemsSource = datasettemp.Tables[0].DefaultView;
		 CbboxPSPredominante1.SelectedValuePath = datasettemp.Tables[0].Columns[0].ToString();
		 CbboxPSPredominante1.DisplayMemberPath = datasettemp.Tables[0].Columns[0].ToString();	

Podem me ajudar por favor?


Share this post

Link to post
Share on other sites

Boas pessoal..

Brutal!!!!! descobri que o facto de estar a usar um tema, era o motivo deste problema.



<ResourceDictionary Source="BureauBlue.xaml"/>


e siga..

Agora vou ver se dá para dar a volta :) e depois dou feedback.


Share this post

Link to post
Share on other sites

Boas novamente,

Para resolver este problema e continuar a usar o tema.

Alterar o contentPresenter da combobox no tema. Neste caso no BureauBlue.xaml

Código de origem:

<ContentPresenter x:Name="contentPresenter" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" />

Código alterado:

<ContentPresenter x:Name="contentPresenter" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}"/>


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.