1

I have 2 comboboxes like on the image and would like to know if it is possible to set some kind of text field for the combobox (so the first box would state Members). This way I would like to get rid of the textboxes above the comboboxes.

enter image description here

I know this can be done by adding the "Members" to the dataset but I donøt want to do that. Is there another way?

BR

7heViking
  • 7,137
  • 11
  • 50
  • 94
  • 1
    possible duplicate of [How to display default text "--Select Team --" in combo box on pageload in WPF?](http://stackoverflow.com/questions/1426050/how-to-display-default-text-select-team-in-combo-box-on-pageload-in-wpf) – ColinE Dec 28 '11 at 08:09
  • That is true. I will look at that question :D – 7heViking Dec 28 '11 at 08:12
  • 1
    See my answer below - that question uses a value converter, however there are other ways to achieve this. The keyword to google for is 'watermark' ;-) – ColinE Dec 28 '11 at 08:13

1 Answers1

2

The effect you are looking for is called a 'watermark', this can be achieved with a value converter as described in the following questions:

Watermark / hint text / placeholder TextBox in WPF

How to display default text "--Select Team --" in combo box on pageload in WPF?

Or via a behaviour, as described in the blogpost:

http://pwlodek.blogspot.com/2009/11/watermark-effect-for-wpfs-textbox.html

Community
  • 1
  • 1
ColinE
  • 68,894
  • 15
  • 164
  • 232