Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1230
xamDataGrid images with different dimensions in different rows not sizing the row height
posted

We are using a style to display a image and some text in a single cell.

the images for different records could be of different sizes so we cannot pre-set the height and width for the images in the style.

so the image in the style have no dimentions specified:

<Image Margin="{TemplateBinding Padding}" Stretch="UniformToFill"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>

the source for the image is a BitmapImage being set using a converter:

<Image.Source>
<MultiBinding Converter="{StaticResource gridSignaturesConverter}">
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="Field" />
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="Record" />
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="Value" />
<Binding RelativeSource="{RelativeSource Self}" />
</MultiBinding>
</Image.Source>

the images render but the records does not size according to the image dimensions.

how do I go about having my records size in height according to the image size?

What it looks like: 

What it SHOULD look like:

  • 34430
    Offline posted

    Hello Key360,

    I have been investigating this behavior you are reporting, and after putting together a basic sample project, I cannot seem to reproduce this issue. I am under the impression that you are re-templating the CellValuePresenter element to show your Images, and so I have done the same thing, and the rows are resizing normally.

    I have attached the sample project I used to test this.  Please test this project on your PC; whether or not it works correctly may help indicate the nature of this problem.

    If the project does not work correctly, this indicates either a problem possibly specific to your environment, or a difference in the DLL versions we are using.  My test was performed using version 18.2.20182.186 in Infragistics for WPF 2018.2.

    If the project does show the product feature working correctly, this indicates a possible problem in the code of your application.  It will help if you can provide a small, isolated sample application that demonstrates the behavior you are seeing.

    Or, if this sample project is not an accurate demonstration of what you're trying to do, please feel free to modify it and send it back, or send a small sample project of your own if you have one.

    Please let me know if you have any other questions or concerns on this matter.

    XDGImageSizesDemo.zip