Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
60
Placing an image in Template column of ultraweb grid
posted

Hi All,

I have the below requirement in my project. I have a template column in which i have an image control. I need to populate the image control by dynamically providing the url. The column is a bound column and the url will be supplied from the bound dataset. Please find the code snippet i used below

  <igtbl:TemplatedColumn AllowResize="Free" BaseColumnName="IS_VALID" IsBound="true" Type="NotSet" Key="IS_VALID">
           <CellTemplate>
             <asp:Image ID="imgValid" runat="server" ImageUrl=<%# DataBinder.Eval(Container.DataItem, "IS_VALID")%> Visible="true"                AlternateText="No Image found" />
             </CellTemplate>
            <Header Caption="Validated" Title="IS_VALID">
             <RowLayoutColumnInfo OriginX="4" />
              </Header>
               <Footer>
                <RowLayoutColumnInfo OriginX="4" />
                 </Footer>
   </igtbl:TemplatedColumn>

The issue I am facing is the column gets populated with the image url insted of the image. Any help on this will be appreciated

Parents
No Data
Reply
  • 28464
    posted

    Weird, the syntax looks good. The only thing that may cause problems is that the ImageUrl value is not inside quotes (single quotes), .e.g.

    ImageUrl='<%# DataBinder.Eval(Container.DataItem, "IS_VALID") %>'

    In case this still does not work, you can try with plain HTML control instead of a server side one

    e.g.

    <img src='<%# DataBinder.Eval(Container.DataItem, "IS_VALID") %>' />

Children
No Data