Skip to main content

All Questions

Tagged with
192 votes
12 answers
197k views

DataTrigger where value is NOT null?

I know that I can make a setter that checks to see if a value is NULL and do something. Example: <TextBlock> <TextBlock.Style> <Style> <Style.Triggers> <...
Timothy Khouri's user avatar
99 votes
4 answers
66k views

Binding Visibility for DataGridColumn in WPF

How can I hide a column in a WPF DataGrid through a Binding? This is what I did: <DataGridTextColumn Header="Column header" Binding="{Binding ColumnValue}" ...
ygoe's user avatar
  • 19.8k
34 votes
6 answers
121k views

Bind visibility property to a variable

I have a Border with Label inside a Window, <Border x:Name="Border1" BorderBrush="Black" BorderThickness="1" HorizontalAlignment="Left" Height="21" Margin="229,164,0,0" VerticalAlignment="Top" ...
7zawel's user avatar
  • 383
31 votes
5 answers
63k views

Dynamically toggle visibility of WPF grid column from C# code

My problem is: I can't find out how to toggle the visibility of my WPF grid column. Assume following XAML markup: <Grid x:Name="myGrid"> <Grid.RowDefinitions> <...
sebi's user avatar
  • 431
30 votes
3 answers
28k views

MultiDataTrigger with OR instead of AND

I am trying to set multiple DataTriggers on my Button. I did some research and found that MultiDataTrigger allows you to do this. I want the Visibility property of my Button to be set to false if the ...
CBreeze's user avatar
  • 2,945
17 votes
2 answers
7k views

MVVM - hiding a control when bound property is not present

I was wondering if it is possible to hide a control on a view if the property to which the control is bound does not exist in the view model. For example, if I have the following: <CheckBox ...
Joe K's user avatar
  • 409
11 votes
2 answers
22k views

WPF Stop Storyboard on Visibility Changed

I have a UserControl with a story board and I want to stop the animation when the control's Visibility changes. I created a Trigger to pause the animation and start it depending on the state, but I ...
HaxElit's user avatar
  • 4,033
11 votes
1 answer
17k views

WPF XAML Grid Visibility Trigger

I have a status message located on the first row of my grid and I want it to slide in and out when the visibility changes. The first visibility trigger works great and slides the first grid row open ...
Mikkeee's user avatar
  • 161
9 votes
3 answers
9k views

How to hide combobox toggle button if there is only one item?

I have a WPF application. In one window there is a combobox..and I want to hide the toggle button and disable the combo box if there is only one item. How would I achieve this ? I have tried the ...
Relativity's user avatar
  • 6,818
8 votes
1 answer
4k views

TargetNullValue for Visibility that's bound to a boolean

I have a Grid whose Visibility property is bound to a boolean property of a certain model using a Converter: <Grid Visibility="{Binding ElementName=MyTreeView, Path=SelectedItem.MyBoolProperty, ...
jebar8's user avatar
  • 2,113
7 votes
3 answers
23k views

Binding Visibility in XAML to a Visibility property

I've seen on the internet quite a few examples of binding a boolean to the Visibility property of a control in XAML. Most of the good examples use a BooleanToVisibiliy converter. I'd like to just ...
Jared's user avatar
  • 6,015
7 votes
6 answers
7k views

WPF toggle panel visibility

I have two panels, only one should be visible at the same time. I change between them by clicking a button, one on each panel. Is there a nice way to do this in xaml without codebehind or viewmodel?
Karsten's user avatar
  • 8,125
6 votes
1 answer
2k views

Adjust the Visibility property of a View not working

I've a strange problem with binding a boolean property to a View's Visibility property. I have a 'main' View that contains a bunch of other Views as well as various other UIElements including Buttons,...
Kirk Broadhurst's user avatar
5 votes
3 answers
9k views

In WPF, how do I set a button's click event to change a grid's visibility?

I'm trying to set a button's event to change a grid's visibility using just XAML. I'm pretty sure I should be using an EventTrigger, but I couldn't get that to work so my most recent attempt is to ...
Scifiballer24's user avatar
4 votes
2 answers
11k views

How to hide items of a combobox in WPF

Is there a way to hide items of a combobox in WPF? In my usercontrol there is a ListBox with checkbox-items bound to an ObservableCollection and a datagrid with a combobox. <ListBox x:Name="...
Andreas Sawatzki's user avatar

15 30 50 per page
1
2 3 4 5 6