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

gird with image column

4 Answers 32 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Troika
Top achievements
Rank 1
Troika asked on 24 Sep 2013, 11:03 AM
how can i have a grid with a image collumn binded image from database

4 Answers, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 24 Sep 2013, 12:21 PM
Hello,

Please check below link and let me know if any concern.

http://demos.telerik.com/aspnet-ajax/controls/examples/integration/raduploadinajaxifiedgrid/defaultcs.aspx?product=binaryimage

Thanks,
Jayesh Goyani
0
Troika
Top achievements
Rank 1
answered on 24 Sep 2013, 12:42 PM
0
Troika
Top achievements
Rank 1
answered on 24 Sep 2013, 01:29 PM
where can i specify na imagepath with the eval to read from db i cant see it
0
Jayesh Goyani
Top achievements
Rank 2
answered on 26 Sep 2013, 05:13 AM
Hello,

Please try with the below  code snippet.

<telerik:RadListBox ID="RadListBox1" runat="server"
          SelectionMode="Multiple">
          <ItemTemplate>
              <telerik:RadBinaryImage ID="RadBinaryImage1" runat="server"
                  ImageUrl='<%# "http://www.google.com/" +  Eval("ID") %>' />
              <asp:Label ID="Label1" runat="server" Text='<%# Eval("Name") %>'> </asp:Label>
          </ItemTemplate>
      </telerik:RadListBox>
protected void Page_Load(object sender, System.EventArgs e)
    {
        dynamic data1 = new[] {
               new { ID = 1, Name ="Name_1",Customdate = DateTime.Now},
               new { ID = 2, Name = "Name_2",Customdate = DateTime.Now},
               new { ID = 3, Name = "Name_3",Customdate = DateTime.Now},
               new { ID = 4, Name = "Name_4",Customdate = DateTime.Now},
               new { ID = 5, Name = "Name_5",Customdate = DateTime.Now}
           };
        RadListBox1.DataSource = data1;
        RadListBox1.DataTextField = "Name";
        RadListBox1.DataValueField = "ID";
        RadListBox1.DataBind();
 
    }

OR
If you stored Image as varbinary in DB then please try with below method.

<telerik:RadBinaryImage ID="RadBinaryImage1" runat="server" DataValue='<%# Eval("Picture") == null ? null : ((Binary) Eval("Picture")).ToArray() %>'


Thanks,
Jayesh Goyani
Tags
Grid
Asked by
Troika
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Troika
Top achievements
Rank 1
Share this question
or