?
Solved

WPF List view controling Row Size

Posted on 2010-08-26
8
Medium Priority
?
843 Views
Last Modified: 2013-11-12
I have a List view in my WPF  application . In its first column we are using image to display something. Whenever I increase the width  of that column row size of all the rows also increases. THe image shown inside the cell also grows up. How can i avoid this particular behaviour.
0
Comment
Question by:expash
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 8

Expert Comment

by:Gururaj Badam
ID: 33531893
can you post your screenshots before and after?
0
 

Author Comment

by:expash
ID: 33536661
A typical example is attached where when width of the first column is increased row height is also increased. Setting the height of the row is possible but it will have its own sideeffect and can not be used.
Prob.JPG
0
 
LVL 8

Expert Comment

by:Gururaj Badam
ID: 33539135
Did you try setting the Image size itself?
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 63

Expert Comment

by:Fernando Soto
ID: 33543591
Hi expash;

Can you please post the XAML and the code behind for the above sample.

Thanks;
Fernando
0
 
LVL 16

Accepted Solution

by:
ToddBeaulieu earned 2000 total points
ID: 33545103
I have a feeling your first image size is proportionate and when you size the column width, the image height also resizes so maintain the proportions. Since the row height sizes to it's contents, it goes along for the ride. If you could post code, I suspect there is a simple solution.
0
 
LVL 8

Expert Comment

by:Gururaj Badam
ID: 33555996
<Rectangle Width="160" Height="120"
      Stroke="Black"
      StrokeThicknexx="1"
  <Rectangle.Fill>
    <ImageBrush ImageSource="image.jpg" />
  </Rectangle.Fill>
</Rectangle>
0
 
LVL 8

Expert Comment

by:Gururaj Badam
ID: 33555998
0
 

Author Closing Comment

by:expash
ID: 33589987
You have accurately diagnsed the problem. Though the solution is suggestive but it is simple as well. Set the "stretch" attribute of image element to "None" and the behaviour will be stopped.  
Actually i am new to C# and WPF and i was trying a very wrong approach. "No resizing of image when column with increase happens" (I was trying to trap events)
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question