views:

26

answers:

2

Hello StackOverflow,

Odd question as I've never attempted this before in my usual data binds.

Say if I was binding data to a textbox and my data was a specific number "123", yet I wanted the textbox to display "Data: 123". Without adding that extra piece of information "Data: " to the return in the object itself, is this possible?

Cheers,

TurtlePower.

+2  A: 

You can do it adding a converter to your control binding, see for example http://timheuer.com/blog/archive/2008/07/30/format-data-in-silverlight-databinding-valueconverter.aspx

Edgar Sánchez
A: 

you will have to modify the data you bind to your controls, even if you dont want the actual data to have it you will have to create some intermediate data source which has your static text and use that for binding.

edgar's answer could help you create this intermediate data source.

Vinay B R