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

dataset and gridviewimagecolumn

7 Answers 182 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Oscar Zapata
Top achievements
Rank 1
Oscar Zapata asked on 08 Mar 2010, 05:00 AM
i have a dataset with a column that contains image in byte format.

how can i do to bind the column in the dataset that contans the image with a gridviewimagecolumn and add to radgridview?

thnks for your help

Oscar Zapata

7 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 08 Mar 2010, 08:15 AM
Hello,

If the field in your DataTable is byte array all you need to do is to set DataMemberBinding to point to this field.

All the best,
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
Oscar Zapata
Top achievements
Rank 1
answered on 08 Mar 2010, 10:13 PM
thanks  for your help vlad

i did that you recomend to me but the images dont appear, here is the code

 

Dim bind As New Binding

 

 

 

Dim colum As New GridViewImageColumn

' this is the column in the dataset that contains the images, each row contains a diferent image  

bind.Source = datos.Tables(0).Columns(11)

 

 

 

 

 

 

 

colum.ImageHeight = 32

colum.ImageWidth = 32

colum.ImageStretch = 0

colum.Header =

"Icons"

 

 

colum.DataMemberBinding = bind

RadGridView1.Columns.Add(colum)


please help me
 
0
Vlad
Telerik team
answered on 09 Mar 2010, 08:14 AM
Hi,

You need to set only property/field name for the Binding - for example:

Dim colum As New GridViewImageColumn

colum.DataMemberBinding = New Binding("YourProperty")

RadGridView1.Columns.Add(colum)


Sincerely yours,
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
Oscar Zapata
Top achievements
Rank 1
answered on 10 Mar 2010, 07:21 PM
Hi!!!

It Doesnt Works!!

i aprecciate if you can help me with an specific example, here is my complete code

RadGridView1.ItemsSource = ds.Tables(0)  ' in this code-line i am assign the source of the radgridview to my dataset ds

 

 

Dim colum As New GridViewImageColumn

 

 

 

 

colum.DataMemberBinding = New Binding("BL_FOTO")  'BL_FOTO is the field that conatins the images in the dataset

RadGridView1.Columns.Add(colum) ' add the column to the radgridview

as you can see in the attach image the images doesnt appear in the grid view image column of the radgridview

please help me
 my best wishes

Oscar Zapata



0
Vlad
Telerik team
answered on 11 Mar 2010, 10:15 AM
Hi,

I've attached an example project to demonstrate you grid with image column bound to DataTable.

Kind 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
Oscar Zapata
Top achievements
Rank 1
answered on 23 Mar 2010, 06:26 AM

i tried to bind a gridviewimagecolumn with the column of datatable  but was imposible that gridviewimagecolumn display the images,
when i bind the column that has the image in byte format with a gridviewdatacolumn in the cells display the image in byte format but when i bind with the gridviewimagecolumn the image doesnt appear, here is the code:

 

Dim column As New GridViewDataColumn

 

column.DataMemberBinding =

New Binding("IDENTFICACIN")

 

RadGridView1.Columns.Add(column)

 

Dim columNombre As New GridViewDataColumn

 

columNombre.DataMemberBinding =

New Binding("NOMBRE")

 

 

Me.RadGridView1.Columns.Add(columNombre)

 

 

 


Dim
columApellido As New GridViewDataColumn

 

columApellido.DataMemberBinding =

New Binding("APELLIDO")

 

 

Me.RadGridView1.Columns.Add(columApellido)

 

 


Dim
columImg As New GridViewImageColumn

 

columImg.DataMemberBinding =

New Binding("BL_FOTO")

 

 

Me.RadGridView1.Columns.Add(columImg)

 

RadGridView1.ItemsSource = data.Tables(0)

as you can see in the attach image the images doesnt appear in the gridviewimagecolumn of the radgridview
the binding  of the rest columns work prefect but althought i follow your recomendation about the binding with the gridviewimagecolumn it doesnt work

Please help me!!!




0
Imran Aliyev
Top achievements
Rank 1
answered on 23 Apr 2010, 12:09 PM
This code in example doesn't wokr. Pls check it.
Tags
GridView
Asked by
Oscar Zapata
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Oscar Zapata
Top achievements
Rank 1
Imran Aliyev
Top achievements
Rank 1
Share this question
or