Questions tagged [ivalueconverter]

IValueConverter is an interface defined in Microsoft .NET XAML for use in WPF, Silverlight and Xamarin.Forms. It is used in data binding to convert data from one format to another. The conversion can be one-way or bidirectional.

The .NET Binding classes have an optional Converter property of type IValueConverter which can be used to convert data from its native internal representation to something more convenient to a specific UI objective. A DateTime object could be converted to a string representation in a particular date/time display format, for example, or a numeric value could be converted to a color value for the background of a status control.

IValueConverter defines two methods: Convert and ConvertBack. Implement Convert to convert the source data to the display data representation. Implement ConvertBack to convert the display data representation to the source data representation. This is useful when the UI allows the user to edit the data. In the DateTime example above, if the display data were bound to a TextBox edit control (and the data binding Mode is set to TwoWay), the user could type in or change the date/time values. The IValueConverter specified on the data binding would be responsible for converting the text the user entered into a DateTime value in its ConvertBack method.

For more information, see the MSDN documentation on the IValueConverter interface.

668 questions
-2
votes
1 answer

Whis is the column not resize?

I have a datagrid and I want to set the width of a column according to some values, so I am trying to use a multibinding in this way:
Álvaro García
  • 18,114
  • 30
  • 102
  • 193
-2
votes
1 answer

WPF Datagrid: Editing values via UI that have been converted using ValueConverter

I have a datagrid with a column "Total Amount". This is a double type and is converted by a IValueConverter to a currency type with the "$" symbol and commas. (1) But the cell needs to be editable so the user can make changes to the row including…
Bandook
  • 658
  • 6
  • 21
-2
votes
1 answer

The Resource 'BoolToInvertedBoolConverter' could not be resolved

I am new on silverlight development. During my activity i have encountered an error which is i mentioned on the title of this post. My main purpose is popup date picker when clicking button.
Lasal Senarath
  • 149
  • 1
  • 13
-2
votes
1 answer

how to change background color using dependency property

i am new at wpf and i am trying to learn dependency property. i trying to change the background color of textbox using text from another textbox. i am able to do it using converters but i want to implement it using dependency property. here is the…
jithin
  • 45
  • 8
-2
votes
2 answers

Bind color to background in WPF

I'm trying to bind color to my UserControl background from double property modified by converter. However because of some reason it isn't work. It never breaks if I had a breakpoint in my convert function. There is button that fires the function…
lingo
  • 1,848
  • 6
  • 28
  • 56
-2
votes
1 answer

Why cannot get image for my listview?

HI to all I facing one problem which is that my IValueConverter cannot get the new image: Is my code correct? XAML FILE:
A-Max Lee
  • 27
  • 1
  • 10
-3
votes
1 answer

WPF Binding SelectedItem to a property of another object

What I'd like to do is lookup a "Category" to bind the SelectedItem to based on CurrentItem.CategoryId where that would match with Category.Id.
-5
votes
1 answer

How to convert PHP array data tables to javascript?

This is the JavaScript code, var tabledata = [ {id:1, name:"Oli Bob", age:"12", gender:"male", height:1, col:"red", dob:"", cheese:1, lucky_no:5}, {id:2, name:"Mary May", age:"1", gender:"female", height:2, col:"blue", dob:"14/05/1982",…
Mike
  • 11
  • 4
1 2 3
44
45