Getting values from listview control

2 posts, 0 answers
  1. Jose
    Jose avatar
    1 posts
    Member since:
    May 2012

    Posted 02 Aug 2012 Link to this post

    Hi all
    I have problems trying to get the values that I have in my listview control
    my code is as follow:
                                        <tr class="rlvISel">
                                                <asp:Button ID="DeselectButton" runat="server" CausesValidation="False" CommandName="Deselect"
                                                    CssClass="rlvBSel" Text=" " ToolTip="Deselect" />
                                                <asp:Button ID="DeleteButton" runat="server" CausesValidation="False" CommandName="Delete"
                                                    CssClass="rlvBDel" Text=" " ToolTip="Delete" />
                                                <asp:Button ID="EditButton" runat="server" CausesValidation="False" CommandName="Edit"
                                                    CssClass="rlvBEdit" Text=" " ToolTip="Edit" />
                                                <asp:Label ID="PolicyIDLabel" runat="server" Text='<%# Eval("PolicyID") %>' />
                                                <asp:Label ID="SUBNameLabel" runat="server" Text='<%# Eval("SUBName") %>' />
                                                <asp:Label ID="PolicyNameLabel" runat="server" Text='<%# Eval("PolicyName") %>' />
                                                <asp:Label ID="PolicyDescriptionLabel" runat="server" Text='<%# Eval("PolicyDescription") %>' />

    the value that I would like to get is PolicyName and PolicyDescription,

    and my code behind is

    when I execute the page I don't get any information under LBselectedTitle.text neither LBSelectedDescr.text
    Nay help will be greatelly appreciated


    Dim values As New Hashtable()
    Dim Name As String = values("PolicyName")
    Dim Description As String = values("PolicyDescription")
    LBSelectedTitle.Text = Name
    LBSelectedDescr.Text = Description
  2. Eyup
    Eyup avatar
    3940 posts

    Posted 03 Aug 2012 Link to this post

    Hello Jose,

    I have already replied to your thread in the support ticket. Nevertheless, I will also write the suggested approach in this post in case others come across the same issue.

    Generally, you will need to use Bind in your declaration instead of Eval in order to be able to use the ExtractValues method.

    For your convenience I have created a sample RadListView web site where I implemented the described approach. Please find the attached application and check it out. In addition, you could refer to the following help topic for alternative ways of accessing the requested item values:
    Selecting Items

    I hope this will prove helpful.

    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.
Back to Top