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
Solved

WPF List view controling Row Size

Posted on 2010-08-26
8
837 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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

791 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