ActualWidth is set by the rendering system, and may be different depending on the widths of other elements and overall size constraints. As a result, it can not be changed.
Questions tagged [actualwidth]
91 questions
2
votes
0 answers
Wpf Width, ActualWidth, and RenderSize same result
I am having trouble when trying to obtain the actual width of a transformed ( rotated ) element in WPF.
I have a rectangle containing an image, in a Canvas. When I rotate the rectangle, I would like to get the rendered width to center it in my…

SetsunaDilandau
- 61
- 6
2
votes
1 answer
Binding to ActualHeight does not work
I tried to create a custom control, having a semitransparent rounded background:
2
votes
3 answers
Set list items to grow to the width of the containing ListView - WPF
I would like the items of my ListView to grow to take up the entire width of the available space within the ListView.
Currently, I have the item's width set like this (the ListView is named listView):
Width="{Binding ActualWidth,…

oillio
- 4,748
- 5
- 31
- 37
2
votes
2 answers
How to get Width of header of a TabItem of TabControl WPF
What I need to do is stop GridSplitter before going far beyond and thus hiding the TabControl. So the idea that hit upon my mind is to Bind the sum of ActualWidths of all Headers of TabItems to the MinWidth of TabControl or the Crid Cell keeping the…

Fawad Khalil
- 357
- 3
- 20
2
votes
1 answer
WPF What happens when a child's width is bound to a parent's actualwidth
So If I have a binding placed on width of a child object that links it to its parent's ActualWidth, what will happen?
My guess is that the parent measures how much width the child wants, the child tells the parent 0 width, then the parent is given…

James Joshua Street
- 3,259
- 10
- 42
- 80
2
votes
1 answer
ActualHeight / ActualWidth of Border is not as expected when binding it dynamically
I have two borders in a Grid in a UserControl. First border is in row one and second border is is in row two.
…

asitis
- 3,023
- 1
- 31
- 55
2
votes
1 answer
Binding the Width Property of a DataGridColumn to the ActualWidth of the parent DataGrid
I tried to solve my previous question with manually binding the Width property of the DataGridTextColumn here is the first Version of my XAML Code.

Julius
- 192
- 1
- 9
1
vote
2 answers
Binding a TextBox's Width to its parent container's ActualWidth
I'm loading a Textbox and a Button into a horizontal StackPanel programmatically. The size of the button (which only contains an Image) is fixed, but I can't get the textbox to fill the available width of its parent. This is what the code looks…

Praetorian
- 106,671
- 19
- 240
- 328
1
vote
1 answer
WPF: Binding to readonly property in code
I'm currently doing some rescaling on data in a valueconverter whenever a panel is redrawn. I want to move some of this processing to the viewmodel as the most of the processing only occurs if the control size or a few other properties change.
To…

DocGigawatts
- 285
- 6
- 15
1
vote
2 answers
silverlight NaN height and width, ActualHeight and ActualWidth also return 0.0 - what is the workaround?
popUpControl and listBoxControl below are returning NaN as the height and width. The ActualHeight is also 0.0
Why? and more importantly what is the workaround for this?

VoodooChild
- 9,776
- 8
- 66
- 99
1
vote
2 answers
Ensuring ActualWidth does not equal 0 in WPF
So I've read that ActualWidth may equal 0 until it is fully loaded. I added its event handler, like so, to make sure it's fully loaded:
text.AddHandler(TextBlock.LoadedEvent, new RoutedEventHandler(textBlock_Loaded));
In the textBlock_Loaded…

Dominic K
- 6,975
- 11
- 53
- 62
1
vote
2 answers
Binding to an element within a UserControl
Say I have a user control like the one below, how would I bind something to the ActualWidth of the "G1" grid from outside of the control?
...
...
…

MJS
- 155
- 3
- 9
1
vote
2 answers
wpf - measuring the actual width and actual height
I have defined a Grid in XAML like,
which is also a part of the other defined grids in xaml file.
In C# file in Constructor,…

Kapparino
- 988
- 11
- 33
1
vote
1 answer
How to create unit test for ActualWidth in Silverlight 4?
How can I write a unit test to test the ActualWidth property in a UserControl in Silverligh 4?
I hoped that this method would pass, but it fails.
I am using the Silverlight ToolKit april 2010, and VS 2010.
_
Public Sub…

eflles
- 6,606
- 11
- 41
- 55
1
vote
1 answer
Wpf How to set Grid Column ActualWidth
Is it generally possible in Grid control to set ActualWidth of Column? This property has only getter. May be there is other way to assign some value to it?
I can set MinWidth, can set Width, so I think it would be logical to have possibility to set…

monstr
- 1,680
- 1
- 25
- 44