Questions tagged [targetnullvalue]

25 questions
17
votes
4 answers

How to hide stringformat if data is null

How to hide a stringformat when data is not present.Consider this sample in this case if Amount is null,Then it will show just Total:.How to hide this if Amount is null or empty
biju
  • 17,554
  • 10
  • 59
  • 95
9
votes
2 answers

WPF Textblock TargetNullValue not working?

I have a wpf textblock as below: At my viewmodel side, I'll have my own logic that in the end, SomeVar.SomeSubVar will be null.…
SuicideSheep
  • 5,260
  • 19
  • 64
  • 117
8
votes
1 answer

How to Set TargetNullValue to Visibility.Collapsed in Binding

I'm binding TextBlock.Visiblitiy to something, and I want to set the Binding.TargetNullValue to Collapsed, how can I do it in XAML? This one How do I set TargetNullValue to a date? does not work in Silverlight. (No x:Static).
Peter Lee
  • 12,931
  • 11
  • 73
  • 100
6
votes
3 answers

Equiv. to Coalesce() in XAML Binding?

In SQL I can do this: Select Coalesce(Property1, Property2, Property3, 'All Null') as Value From MyTable If Property1, 2 and 3 are all null, then I get 'All Null' How do I do this in XAML? I tried the following, but no luck:
Jerry Nixon
  • 31,313
  • 14
  • 117
  • 233
6
votes
1 answer

How do I set TargetNullValue to a date?

I'm using the WPF toolkit's Calendar control to allow users to select a date. If the date is not yet selected then the property the SelectedDate is bound to is Null. This makes the Calendar default you January 1, 0 AD. I'd like to do something…
Bryan Anderson
  • 15,969
  • 8
  • 68
  • 83
5
votes
1 answer

WPF TargetNullValue returning value when the textbox's binding is set to OneWayToSource

I have this xaml textbox binded to this this property: public…
Martín Coll
  • 3,368
  • 3
  • 37
  • 52
4
votes
3 answers

DataTemplate with TargetNullValue in a ListBox

I have the following DataTemplate in a Listbox
Bryan Anderson
  • 15,969
  • 8
  • 68
  • 83
4
votes
2 answers

WPF ObservableCollection: How to add a blank line in one form's combobox, but not actually affect the ObservableCollection?

I have a static ObservableCollection in a Data Repository class. I use it to populate a combobox on one of my forms (which needs to be able to include a blank line which represents NULL). I use the same ObservableCollection to populate a DataGrid,…
myermian
  • 31,823
  • 24
  • 123
  • 215
3
votes
1 answer

C#/WPF Textbox error : "Value '' cannot be converted", TargetNull not working

I have a Listview and a Textboxbinded to the selected item. When the user deletes the value in the textbox (which is a double), I get the following error : Value '' cannot be converted. So I had TargetNullValue='', like this :
jcr
  • 303
  • 1
  • 6
  • 16
3
votes
2 answers

How to get null value from SQLite database in Android

I am having trouble getting a null value from SQLite database using Android. My database has 10 columns. From column 1 to 8 all are filled with values. But there are several rows where the values in column 9 and column 10 are either null or some…
NewestStackOverflowUser
  • 2,792
  • 5
  • 22
  • 31
3
votes
1 answer

Binding Fails Silently for Nested Property

I am trying to bind a dependency property to an INotifyPropertyChanged-enabled property with a multi-level property path. When the owner object of the property is not null, the binding works, but if the owner object is null, the binding does not do…
O. R. Mapper
  • 20,083
  • 9
  • 69
  • 114
2
votes
2 answers

Detecting a missing sub!, sort!, map!, etc

After returning to Ruby from a long stint coding in another language, I regularly assume that foo.sort, foo.map {...}, foo.sub /bar/, 'zip' will change foo. Of course I meant foo.sort!, etc. But that usually takes 3 or 4 debugging potshots before…
Camille Goudeseune
  • 2,934
  • 2
  • 35
  • 56
1
vote
1 answer

Find null and fill with a correspondent value based on another columns value

If on column A I have the ID number of people, and column B I have their names, but I have many rows where the ID is entered but the name is missing, assuming, same person, same Id and supposedly same name. How can I to locate null on column B, grab…
1
vote
0 answers

Xaml Bindings - updating my backer variable based on the TargetNullValue

When Binding, I know it is possible to create a fallback value; If your xaml can't find the property you are binding to, it will 'fall back' to whatever you put here. You can also create a targetNullValue, just in case your binding returns null. …
bwall
  • 984
  • 8
  • 22
1
2