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

How to bind radbinaryimage on row select in radgrid in client side

2 Answers 228 Views
Grid
This is a migrated thread and some comments may be shown as answers.
ALEX
Top achievements
Rank 1
ALEX asked on 28 Nov 2012, 06:17 AM
function RowSelected(sender, args) {

                
                document.getElementById("<%= EmployeeImage.ClientID %>").innerHTML =
                  args.getDataKeyValue("ResourceImage");
              
               }

 <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" ShowFooter="True"
            Style="outline: 0" GroupingEnabled="true" ShowGroupPanel="false" AutoGenerateColumns="False"
            
       
            <MasterTableView ClientDataKeyNames="RecId,ResourceImage" 
                AutoGenerateColumns="false" DataKeyNames="RecId" ShowFooter="true" PagerStyle-Mode="NextPrevAndNumeric" IsFilterItemExpanded="false" >
<columns>
 <telerik:GridBinaryImageColumn DataField="ResourceImage" HeaderStyle-Width="50px" HeaderText="Image" ResizeMode="Fit" 
                                UniqueName="ResourceImage" ImageHeight="30px" ImageWidth="20px" ItemStyle-Wrap="false" >
                            </telerik:GridBinaryImageColumn>
</columns>...

  <telerik:RadBinaryImage ID="EmployeeImage"  runat="server"
                                        Height="50px" Width="50px"  />
          
                
            Help me on this

2 Answers, 1 is accepted

Sort by
0
ALEX
Top achievements
Rank 1
answered on 28 Nov 2012, 01:36 PM
Hi pls give me solution guys,on my radgrid i have gridbinaryimagecolumn ,on row select i need to bind the image to radbinaryimage on row select in client side,i already passed textbox value like this

   
            function RowSelected(sender, args) {
     
                document.getElementById("<%= lbl_id.ClientID %>").innerHTML =
                  args.getDataKeyValue("RecId");
}

Here recid is bound column,likee this i need to pass radimage too

pls give me solution as soon as possible

Anyone pls reply immediately ,otherwise,tell its not possible,post anything ,pls respond soon

No one there give the response
0
Andrey
Telerik team
answered on 03 Dec 2012, 06:51 AM
Hi,

As you could verify from this help topic, RadBinaryImage is designed to display binary data store in a database. On the client RadBinaryImage renders IMG tag with source attribute pointing to the image that should be displayed.

RadBinaryImage does not provide client-side API for changing the displayed image dynamically. If you want to change image dynamically on the client it is better to use simple IMG tag and specify its image with JavaScript.

Regards,
Andrey
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
ALEX
Top achievements
Rank 1
Answers by
ALEX
Top achievements
Rank 1
Andrey
Telerik team
Share this question
or