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

Try to bind data at image in radlistview

1 Answer 71 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Daniel asked on 30 Aug 2012, 06:54 AM

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

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 31 Aug 2012, 07:14 AM
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.
Tags
ListView
Asked by
Daniel
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or