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

[Solved] Upload and Display image in a Column

4 Answers 289 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.
JungTae
Top achievements
Rank 1
JungTae asked on 04 Oct 2010, 03:44 PM
Hello Telerik team, I am using your RadGridView to display the data that I recieve from the SQL server 2005. Our image is saved as byte array, and I need to display it in a column. Also, the user must be able to upload a new image and replace the old one. What is the best way to display and update image files using your RadGridView columns?

It would be ideal to allow the users to upload the data by clicking on a imagecolumn cell

Also, is there a way to resize the image that is being binded to the imageColumn? Here is my code for the datagrid in concern

<telerikDataView:RadGridView x:Name="ModelParametersList"
                                                 AutoGenerateColumns="False"
                                                 ItemsSource="{Binding ElementName=PricingModelGrid,Path=SelectedItem.EFParameterNames}"
                                                 MaxWidth="1000">
                    <telerikDataView:RadGridView.Columns>
                        <telerikDataView:GridViewDataColumn Header="Params" DataMemberBinding="{Binding Name,Mode=TwoWay}"/>
                        <!--  Working Code-->
                        <telerikDataView:GridViewImageColumn x:Name="ImageColumn" Header="JPEG" DataMemberBinding="{Binding JPEG}" >
                              
                        </telerikDataView:GridViewImageColumn>
                              
                          
                         
                        <telerikDataView:GridViewDataColumn Header="Types" >
                            <telerikDataView:GridViewDataColumn.CellTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding EFMktDataType.Name,Mode=TwoWay}" />
                                </DataTemplate>
                            </telerikDataView:GridViewDataColumn.CellTemplate>
                            <telerikDataView:GridViewDataColumn.CellEditTemplate>
                                <DataTemplate>
                                    <ComboBox x:Name="typeSelection" 
                                              ItemsSource="{Binding typeList.Types,Mode=TwoWay}"
                                              SelectedItem="{Binding Types,Mode=TwoWay}" 
                                              SelectionChanged="typeSelection_SelectionChanged" 
                                              Loaded="typeSelection_Loaded">
                                    </ComboBox>
                                </DataTemplate>
  
                            </telerikDataView:GridViewDataColumn.CellEditTemplate>
  
                        </telerikDataView:GridViewDataColumn>
  
  
  
                    </telerikDataView:RadGridView.Columns>
  
                </telerikDataView:RadGridView>

4 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 07 Oct 2010, 09:45 AM
Hi JungTae,

I believe that the following blog posts will be very useful for you:

Displaying Images stored in MS SQL with RadGridView for WPF/Silverlight 
Uploading and displaying images from WCF in Silverlight

Greetings,
Vanya Pavlova
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
Matt
Top achievements
Rank 1
answered on 30 Oct 2010, 09:23 PM
This does not give an answer on how to edit images in GridViewImageColumn. If would be a very userfulf if you could demonstrate a way of editing images in RadGridView. Many thanks.
0
Vanya Pavlova
Telerik team
answered on 04 Nov 2010, 01:13 PM
Hi Oleg,

Could you please share with us what do you mean with "a way fo editing images in RadGridView"? 
I suppose that there is something specific in your case and the approaches you could use are different. It could be great if we have a more information about your custom scenario.

Kind regards,
Vanya Pavlova
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
Matt
Top achievements
Rank 1
answered on 04 Nov 2010, 01:19 PM
I have managed to solve the problem (of double click on GridViewImageColumn to edit/add new image). Thanks for the reply.
Tags
GridView
Asked by
JungTae
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Matt
Top achievements
Rank 1
Share this question
or