Click here to Skip to main content
15,897,518 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED)) Pin
almog.ori27-Jul-10 22:47
almog.ori27-Jul-10 22:47 
AnswerRe: Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED)) Pin
Vimalsoft(Pty) Ltd26-May-11 0:30
professionalVimalsoft(Pty) Ltd26-May-11 0:30 
Questionbeginsavechanges help Pin
LT9996-Sep-09 21:06
LT9996-Sep-09 21:06 
QuestionStyling an AdornerLayer Pin
Etienne_1235-Sep-09 2:39
Etienne_1235-Sep-09 2:39 
AnswerRe: Styling an AdornerLayer Pin
Pete O'Hanlon5-Sep-09 3:15
mvePete O'Hanlon5-Sep-09 3:15 
Question3D model as Splash Pin
Etienne_1235-Sep-09 2:27
Etienne_1235-Sep-09 2:27 
AnswerRe: 3D model as Splash Pin
Pete O'Hanlon5-Sep-09 3:11
mvePete O'Hanlon5-Sep-09 3:11 
QuestionListView Expands Height But Doesn't Contract It Pin
AspDotNetDev4-Sep-09 13:37
protectorAspDotNetDev4-Sep-09 13:37 
It seems that the WPF ListView expands when the content height increases, but it does not contract when the content height decreases. Here is a simple example that demonstrates the issue:

XML
<Window x:Class="TestShrinkListView.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Window1" Height="300" Width="300">
    <Border BorderThickness="2" BorderBrush="Red" VerticalAlignment="Top">
        <ListView Height="Auto" VerticalAlignment="Top">
            <ListViewItem>
                <TextBox AcceptsReturn="True">Type some text here.</TextBox>
            </ListViewItem>
        </ListView>
    </Border>
</Window>


If you run that and press ENTER a few times, you'll make the TextBox increase it's height, and the ListView will expand to accommodate the new height. However, if you delete a few lines from the TextBox, the ListView remains at the same enlarged height.

Is there an easy way to make the ListView decrease its height when the content shrinks (e.g., a height property), or am I going to have to get clever with some special coding?

If I have to get clever, one thing I did notice is that removing a ListViewItem from the ListView causes the ListView to contract to the proper size. I suppose I could look into how that exactly happens, but I would really prefer a cleaner solution.

If you have any ideas, please run them by me. I'd love to hear your opinion. Thanks!

Visual Studio is an excellent GUIIDE.

GeneralWhy Does It Do That? [moved] Pin
#realJSOP4-Sep-09 0:07
professional#realJSOP4-Sep-09 0:07 
GeneralRe: Why Does It Do That? Pin
peterchen4-Sep-09 0:12
peterchen4-Sep-09 0:12 
GeneralRe: Why Does It Do That? Pin
#realJSOP4-Sep-09 0:26
professional#realJSOP4-Sep-09 0:26 
GeneralRe: Why Does It Do That? Pin
Rajesh R Subramanian4-Sep-09 0:48
professionalRajesh R Subramanian4-Sep-09 0:48 
GeneralRe: Why Does It Do That? Pin
Rage4-Sep-09 1:01
professionalRage4-Sep-09 1:01 
GeneralRe: Why Does It Do That? Pin
#realJSOP4-Sep-09 2:14
professional#realJSOP4-Sep-09 2:14 
GeneralRe: Why Does It Do That? Pin
Mycroft Holmes5-Sep-09 14:34
professionalMycroft Holmes5-Sep-09 14:34 
GeneralRe: Why Does It Do That? Pin
Dario Solera4-Sep-09 1:23
Dario Solera4-Sep-09 1:23 
GeneralRe: Why Does It Do That? Pin
OriginalGriff4-Sep-09 1:25
mveOriginalGriff4-Sep-09 1:25 
GeneralRe: Why Does It Do That? Pin
Jim Crafton4-Sep-09 3:15
Jim Crafton4-Sep-09 3:15 
GeneralRe: Why Does It Do That? Pin
peterchen4-Sep-09 3:21
peterchen4-Sep-09 3:21 
QuestionUsing a resource in multiple places Pin
Etienne_1233-Sep-09 8:10
Etienne_1233-Sep-09 8:10 
AnswerRe: Using a resource in multiple places Pin
Daniel Larocque3-Sep-09 8:41
Daniel Larocque3-Sep-09 8:41 
GeneralRe: Using a resource in multiple places Pin
Etienne_1234-Sep-09 1:01
Etienne_1234-Sep-09 1:01 
GeneralRe: Using a resource in multiple places Pin
Pete O'Hanlon4-Sep-09 1:13
mvePete O'Hanlon4-Sep-09 1:13 
GeneralRe: Using a resource in multiple places Pin
Daniel Larocque4-Sep-09 1:15
Daniel Larocque4-Sep-09 1:15 
GeneralRe: Using a resource in multiple places Pin
Etienne_1234-Sep-09 2:19
Etienne_1234-Sep-09 2:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.