Try to bind data at image in radlistview

2 posts, 0 answers
  1. Daniel
    Daniel avatar
    35 posts
    Member since:
    Jan 2011

    Posted 30 Aug 2012 Link to this post

    Hey Community,

     

    i hope you can help me.

     

    I use the RadListView Control. In that I have the asp.net image control.

    I try to bind a path from my Database at the image in the RadListView Control.

     

    But it doesn’t work…

    I found this code:

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
           For Each item As RadListViewDataItem In rlvGalerie.Items
                Dim fcimgGalerie As Image = DirectCast(item.FindControl("imgGalerie"), Image)
                Dim Verzeichnis As String = Hilfsfunktion.GetCRTUploadVerzeichnisZuordnung(13, "Dateisystem")
                fcimgGalerie.ImageUrl = Verzeichnis & "\" & SlidewayGalerie.GETDateiName(13)
            Next
    End Sub

    Thats the control definition:

            <telerik:RadListView ID="rlvGalerie" runat="server" DataSourceID="sdsGalerie" Skin="Windows7">
                <LayoutTemplate>
                    <asp:PlaceHolder runat="server" ID="itemPlaceholder"></asp:PlaceHolder>
                </LayoutTemplate>
                <ItemTemplate>
                    <div style="float: left; margin: 5px; padding: 2px; background: #eeeeee;" class="myClass"
                        onmouseover="containerMouseover(this)" onmouseout="containerMouseout(this)">
                        <asp:ImageButton ID="imgGalerie" ImageUrl="" Width='<%# ImageWidth %>'
                            Height='<%# ImageHeight %>' runat="server" OnClientClick="openRWGalerie(window.location.pathname;)"
                            Style="margin: 0; padding: 0;" />
                    </div>
                </ItemTemplate>
            </telerik:RadListView>

    I hope you can help my

    Greetings Daniel
    Sorry for my Englich

  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 31 Aug 2012 Link to this post

    Hi,

    Try accessing the ImageButton as shown below.
    VB:
    Protected Sub Page_Load(sender As Object, e As EventArgs)
        For Each item As RadListViewDataItem In RadListView1.Items
    Dim fcimgGalerie As ImageButton = DirectCast(item.FindControl("imgGalerie"), ImageButton)
        Next
    End Sub

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top