Skip to main content

All Questions

Tagged with
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
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
2 votes
1 answer
4k views

XAML Grid Visibility Transition?

I have a Grid that has Visibility bound to a property in my viewmodel. This all works fine -- the Grid appears/disappears correctly. My question is, how can I apply a transition so that instead of ...
Steve Macdonald's user avatar
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
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
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
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
4 votes
2 answers
6k views

Lazy loading of non-visible elements

I have a case where I have either a gridview/listbox/any type of items control and the number of items bound to the control is massive (easily around 5000+ mark). Each of these items needs to have ...
user avatar
1 vote
2 answers
3k views

How to set Visibility of Label which is bound to Textbox?

I have three TEXTBOX which are bound to LABEL. When I type something in TEXTBOX then TextBox text value is set to Label. Problem is i want to set Visiblity of LABEL to COLLAPSED when text box is blank ...
SHEKHAR SHETE's user avatar
1 vote
2 answers
14k views

WPF: Binding to MainWindow Property

I am having an issue with binding to a parent MainWindow property, MainContentVisibility. I have the following code: MainWindow.xaml <Window x:Class="CallTracker.WPF.MainWindow" xmlns="...
BrianKE's user avatar
  • 4,155
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
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

15 30 50 per page