Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > RadControls in DotNetNuke > RadBinaryImage DataValue

Not answered RadBinaryImage DataValue

Feed from this thread
  • kiran avatar

    Posted on Dec 17, 2011 (permalink)

    Hi ,
    I am doing a project in which i am using RadBinaryimage and i want to get the image that is stored in my database sql server .This is the code i am using to get the image which is stored in  my database But i am not able to Get the image .

    This is the code 

    <div class="rlv">
       <telerik:RadListView ID="EmployeesListView" runat="server" 
    Width="100%" AllowPaging="True" PageSize="4" AllowCustomPaging="True" DataKeyNames="EmpID_PK" 
    OnSelectedIndexChanged="EmployeesListView_SelectedIndexChanged" OnNeedDataSource="EmployeesListView_NeedDataSource">
    <LayoutTemplate>
    <table class="rlv" cellpadding="0" cellspacing="7" border="0">
    <tr>
    <asp:PlaceHolder ID="itemPlaceHolder" runat="server"></asp:PlaceHolder>
    </tr>
    </table>
    </LayoutTemplate>
    <ItemTemplate>
    <td class="rlvItem" onmouseover="employeeMouseOver(this)" onmouseout="employeeMouseOut(this)">
    <asp:LinkButton ID="EmployeesListView" runat="server" CommandName="Select" OnClientClick="ShowLoadingPanel()">
    <telerik:RadBinaryImage ID="RadBinaryImage1" runat="server" Width="70px" Height="70px"
    ResizeMode="Fit"   DataValue='<%# Eval("Photo") %>'
    AlternateText='<%# Eval("FirstName") + " " + Eval("LastName") %>'
    CssClass="photo" />
    <%# Eval("FirstName") + "<br/><span>" + Eval("LastName") + "</span>" %>
    <asp:Label ID="PercentageLabel" runat="server" class="percentage" Text='
    <%# Eval("FirstName").ToString()  %>'></asp:Label>
    </asp:LinkButton>
    </td>
    </ItemTemplate>
    <SelectedItemTemplate>
    <td class="rlvSelected" onmouseover="employeeMouseOver(this)" onmouseout="employeeMouseOutSelected(this)">
    <asp:LinkButton ID="LinkButton1" runat="server" CommandName="Select" OnClientClick="ShowLoadingPanel()">
    <telerik:RadBinaryImage ID="RadBinaryImage1" runat="server" Width="70px" Height="70px"
    ResizeMode="Fit"  DataValue='<%# Eval("Photo") %>' 
    AlternateText='<%# Eval("FirstName") + " " + Eval("LastName") %>'
    CssClass="photo" />
    <%# Eval("FirstName") + "<br/><span>" + Eval("LastName") + "</span>" %>
    <asp:Label ID="PercentageLabel" runat="server" class="" Text='
    <%# Eval("FirstName").ToString()  %>'></asp:Label>
    </asp:LinkButton>
    </td>
    </SelectedItemTemplate>
    </telerik:RadListView>
           <!--<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:sampleConnectionString %>" 
                    SelectCommand="SELECT * FROM [Employee]"></asp:SqlDataSource>-->
           <telerik:RadSlider ID="PagerSlider" runat="server" MinimumValue="0" CssClass="slider"
       DecreaseText="Prev" IncreaseText="Next" DragText='<%# "Page " + (EmployeesListView.CurrentPageIndex + 1).ToString() + " of 5"  %>'
       AutoPostBack="true" OnValueChanged="PagerSlider_ValueChanged" >
       </telerik:RadSlider>






    And  This is the .cs file 


     connection con =new connection
     protected void EmployeesListView_NeedDataSource(object sender, RadListViewNeedDataSourceEventArgs e)
        {
            DataSet ds = new DataSet();


            ds = con.excuteQueryWithdataset("select * from TBL_User ");


           EmployeesListView .DataSource = ds;


           
        }


    I am able the display other values but not the image that is there in my database which is in the column named Photo
    i used the dataValue as u can see but still i am not able to get the image on to my UI.


    Regards
    Kirancharley



    Reply

  • jumpstart Master avatar

    Posted on Dec 19, 2011 (permalink)

    Kirancharley:

    You state that you're not able to "get the image", but do you receive any errors? The "datavalue" property of the RadBinaryImage control expects a byte[] and the supported image types are bmp, jpeg, jpg, gif and png.

    See the "Issue with RadBinaryImage DataValue" for more insights.

    Cheers!
    Richard

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > RadControls in DotNetNuke > RadBinaryImage DataValue