I am using c# and sql database.
Database contains two filed 1.ID - Int
2.Picture - Image
I had binded the database to radList view ,picture is set as Display member and ID is set as value member.
Problem is pictures are not showing .How to display pictures ?
1 Answer, 1 is accepted
0
Stefan
Telerik team
answered on 24 Jan 2013, 09:35 AM
Hi Anoop,
Thank you for writing.
To assign an image to ListViewData item from your underlying DataRow, you should use the ItemDataBound event as explained in this help article. Here is a small sample:
public Form1()
{
InitializeComponent();
DataTable t = new DataTable();
t.Columns.Add("ID");
t.Columns.Add("Image", typeof(Image));
t.Rows.Add("1", Image.FromFile(@"C:\Program Files (x86)\Telerik\RadControls for WinForms Q3 2012\Examples\QuickStart\Resources\BE.png"));
t.Rows.Add("1", Image.FromFile(@"C:\Program Files (x86)\Telerik\RadControls for WinForms Q3 2012\Examples\QuickStart\Resources\BR.png"));
t.Rows.Add("1", Image.FromFile(@"C:\Program Files (x86)\Telerik\RadControls for WinForms Q3 2012\Examples\QuickStart\Resources\BUL.png"));