This is a migrated thread and some comments may be shown as answers.

Setting an Image on the GridViewImageColumn for entire column

3 Answers 280 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 1
Ryan asked on 31 Dec 2009, 12:57 AM
Hello,

  Is it possible to set the image on a GridViewImageColumn without having to set the URL inside the actual object you are binding to?  For example can I do something like this:

<telerikGrid:GridViewImageColumn DataMemberBinding="../Images/MyImage.jpg" ImageStretch="None" />

3 Answers, 1 is accepted

Sort by
0
Ryan
Top achievements
Rank 1
answered on 31 Dec 2009, 03:35 PM
If anyone needs this - I answered my own question, use the data template.  Example:

 

 

<telerikGridView:RadGridView.Columns>

 

 

 

    <telerikGridView:GridViewColumn UniqueName="img" Width="28">

 

 

 

        <telerikGridView:GridViewColumn.CellTemplate>

 

 

 

            <DataTemplate>

 

 

 

                <Image Stretch="None" Source="../Images/MyImage.png" HorizontalAlignment="Center" />

 

 

 

            </DataTemplate>

 

 

 

        </telerikGridView:GridViewColumn.CellTemplate>

 

 

 

    </telerikGridView:GridViewColumn>
</telerikGridView:RadGridView.Columns>

 

0
Marc Roussel
Top achievements
Rank 2
answered on 07 Mar 2010, 12:58 PM
Please who can tell me where to set the image on the GridViewImageColumn based on the image attached ?
Also I have a very hard time to do anything with the grid in Blend 3 UI only not relying on doing things by xaml code.

Same problem when I want to have a certain Style for a column.  How do you do things with Blend 3 UI only ???
0
Fábio
Top achievements
Rank 1
answered on 03 Aug 2017, 08:16 PM
<telerikGridView:RadGridView.Columns>
    <telerikGridView:GridViewColumn UniqueName="img" Width="28">
        <telerikGridView:GridViewColumn.CellTemplate>
            <DataTemplate>
                <Image Stretch="None" Source="../Images/MyImage.png" HorizontalAlignment="Center" />
            </DataTemplate>
        </telerikGridView:GridViewColumn.CellTemplate>
    </telerikGridView:GridViewColumn>
</telerikGridView:RadGridView.Columns>
Tags
GridView
Asked by
Ryan
Top achievements
Rank 1
Answers by
Ryan
Top achievements
Rank 1
Marc Roussel
Top achievements
Rank 2
Fábio
Top achievements
Rank 1
Share this question
or