Solved

WPF List view controling Row Size

Posted on 2010-08-26
8
831 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
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
 
LVL 62

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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 16

Accepted Solution

by:
ToddBeaulieu earned 500 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Dialogbox API leak? 18 62
Windows Service with UDP 2 28
C# SQL BULK INSERT CLASS 5 36
getting id from database 5 24
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now