Solved

WPF List view controling Row Size

Posted on 2010-08-26
8
838 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying 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

Title # Comments Views Activity
insert value of checklistbox checked 4 39
C# Linq - Join two objects into one 3 37
Upgrade code from VS 2010 to VS 2015 7 35
Problem to copy file 14 55
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…
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…
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

730 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