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

RadGridView Image with Text in a Grid Column issue

2 Answers 38 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Sharath Nair
Top achievements
Rank 1
Sharath Nair asked on 21 Apr 2010, 01:59 PM
Hi there,

I am trying to render an Image and a Text value to a Grid column. The Image and Text are rendered based on a integer value that the Grid column gets.. i.e IconID = 1,2,3,4..............  When the value is passed to the Grid column, I am using a converter to create an Image and Text based on a value.  Please see my code below.

This is my Data Template
------------------------------------------------------------------------------------------------------------------------------------------------------------

<

 

 

DataTemplate x:Name="GridIconTemplate">

 

 

 

 

<StackPanel x:Name="blockTypeImage" Orientation="Horizontal" Width="80" Height="20">

 

 

 

 

<Image Name="ImgIcon" Width="40" Stretch="Fill" Source="{Binding IconID,Converter={StaticResource ValueToImageConverter}}" Height="20"></Image>

 

 

 

 

<TextBlock Name="txtBlockType" Width="40" Text="{Binding IconID,Converter={StaticResource ValueToTextConverter}}" Height="20" />

 

 

 

 

</StackPanel>

 

 

 

 

</DataTemplate>


 

This datatemplate is used by the column
----------------------------------------------------------------------------
<
radgridview:GridViewDataColumn Header="Icon" UniqueName="Icon"

 

 

 

 

 

 

 

IsReadOnly="True" CellTemplate="{StaticResource GridIconTemplate}">

 

 

 

 

 

 

 

 

</radgridview:GridViewDataColumn>
---------------------------------------------------------------------------

The column when loading gets no value... The converter code also is not getting called.. due to which I am not able to debug the issue.


Please do let me know your valuable suggestion for me to solve this isssue...


Regards,
Sharath

 

2 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 21 Apr 2010, 02:16 PM
Hi,

You can check if the binding is valid - converter will not work for invalid bindings.

Regards,
Vlad
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Sharath Nair
Top achievements
Rank 1
answered on 21 Apr 2010, 02:33 PM
Hey,

thanks for that.. it was not IconID .. but IconId... the D was in caps...

That helped....  thanks a ton.

Sharath
Tags
GridView
Asked by
Sharath Nair
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Sharath Nair
Top achievements
Rank 1
Share this question
or