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

[Solved] Adding Images column to Silverlight Gridview

4 Answers 208 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Abhishek Chauhan
Top achievements
Rank 1
Abhishek Chauhan asked on 24 Sep 2009, 08:42 AM
I am using Silverlight 3.0 and I need to display icons\images for few columns (for edit & delete) in the radgridview.
I am using the code given below for the same but the icons are not getting displayed.

<

 

telerikGridView:RadGridView Name="newDataGrid" MultipleSelect="True">

 

 

 

 <telerikGridView:RadGridView.Columns>

 

 

 

 <telerikGridView:GridViewColumn HeaderText="Picture">

 

 

 

 <telerikGridView:GridViewColumn.CellTemplate>

 

 

 

 <DataTemplate x:Name="dtTemp">

 

 

 

 <Image x:Name="img" Source="\ClientBin\Images\Edit.gif"/>

 

 

 

 </DataTemplate>

 

 

 

 </telerikGridView:GridViewColumn.CellTemplate>

 

 

 

</telerikGridView:GridViewColumn>

 

 

 

</telerikGridView:RadGridView.Columns>

 

 

</telerikGridView:RadGridView>

My Images folder is inside the ClentBin folder only.
Please help me to get this done.

Thanks in Advance,
Abhishek Chauhan


 

 

 

 

 

 

 

4 Answers, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 24 Sep 2009, 10:58 AM
Hi Abhishek Chauhan,

Could you try to use
<Image x:Name="img" Source="Images/Edit.gif"/>  
instead? It might work.

Best wishes,
Milan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Abhishek Chauhan
Top achievements
Rank 1
answered on 24 Sep 2009, 11:26 AM
Hi Milan,

Thanks for the quick response, but I have already tried this....it gives the following error-
Sys.InvalidOperationException: ImageError #4001 in control 'Silverlight1': AG_E_NETWORK_ERROR.

I am not sure whats wrong with this.

Thanks & Regards,
Abhishek
0
Milan
Telerik team
answered on 24 Sep 2009, 11:53 AM
Hi Abhishek Chauhan,

This means that something else is wrong. I am sending you a sample project that demonstrates how an image form ClientBin can be displayed in RadGridView. I hope that the project will help you fix the problem in your original solution.

Kind regards,
Milan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Abhishek Chauhan
Top achievements
Rank 1
answered on 25 Sep 2009, 06:42 AM
Hi Milan,

Thanks for the sample project.
After wasting so much time, finally I realized that there was nothing wrong with my code, it was just that I was using .gif images and probably Silverlight doesn't takes this format.....I just used a .png image and everything is working fine now.
Thanks agin for the sample project.

Thanks & Regards,
Abhishek Chauhan
Tags
GridView
Asked by
Abhishek Chauhan
Top achievements
Rank 1
Answers by
Milan
Telerik team
Abhishek Chauhan
Top achievements
Rank 1
Share this question
or