Enable Click or how do I make this seclectable.

2 posts, 0 answers
  1. Stephan
    Stephan avatar
    33 posts
    Member since:
    Jun 2012

    Posted 21 Mar 2012 Link to this post

    I am using a single row listview as a means to navigate my file.  The list view loads properly, but when I put my cursor over the item the cursor doesn't change to a pointing finger and when I click on the item I want, none of my code is executed in my behind code.

    </div>
    <telerik:GridTextBoxColumnEditor ID="GridTextBoxColumnEditor1" runat="server">
    </telerik:GridTextBoxColumnEditor>
    <asp:SqlDataSource ID="salesreps" runat="server"
        ConnectionString="<%$ ConnectionStrings:cbfSQLConnectionString %>"
        SelectCommand="SELECT [firstname], [lastname] FROM [salesrep] ORDER BY [termdate], [salesno]">
    </asp:SqlDataSource>
    <telerik:RadListView ID="RadListView1" runat="server" DataSourceID="salesreps" 
        onneeddatasource="RadListView1_NeedDataSource" AllowPaging="True">
        <LayoutTemplate>
            <div class="RadListView RadListView_Forest">
                <table cellspacing="0">
                    <tr>
                        <td ID="itemPlaceholder" runat="server">
                        </td>
                    </tr>
                </table>
            </div>
        </LayoutTemplate>
        <ItemTemplate>
            <td class="rlvI">
                <asp:Label ID="firstnameLabel" runat="server" Text='<%# Eval("firstname") %>' />
                <br/>
                <asp:Label ID="lastnameLabel" runat="server" Text='<%# Eval("lastname") %>' />
                <br/>
            </td>
        </ItemTemplate>
        <AlternatingItemTemplate>
            <td class="rlvA">
                <asp:Label ID="firstnameLabel" runat="server" Text='<%# Eval("firstname") %>' />
                <br/>
                <asp:Label ID="lastnameLabel" runat="server" Text='<%# Eval("lastname") %>' />
                <br/>
            </td>
        </AlternatingItemTemplate>
        <EditItemTemplate>
            <td class="rlvIEdit">
                <table cellspacing="0" class="rlvEditTable">
                    <tr>
                        <td>
                            <asp:Label ID="firstnameLabel2" runat="server" 
                                AssociatedControlID="firstnameTextBox" Text="firstname">
                            </asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="firstnameTextBox" runat="server" CssClass="rlvInput"
                                Text='<%# Bind("firstname") %>' />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lastnameLabel2" runat="server"
                                AssociatedControlID="lastnameTextBox" Text="lastname">
                            </asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="lastnameTextBox" runat="server" CssClass="rlvInput"
                                Text='<%# Bind("lastname") %>' />
                        </td>
                    </tr>
                </table>
            </td>
        </EditItemTemplate>
        <EmptyDataTemplate>
            <div class="RadListView RadListView_Forest">
                <div class="rlvEmpty">
                    There are no items to be displayed.
                </div>
            </div>
        </EmptyDataTemplate>
        <SelectedItemTemplate>
            <td class="rlvISel">
                <asp:Label ID="firstnameLabel" runat="server" Text='<%# Eval("firstname") %>' />
                <br/>
                <asp:Label ID="lastnameLabel" runat="server" Text='<%# Eval("lastname") %>' />
                <br/>
            </td>
        </SelectedItemTemplate>
    </telerik:RadListView>
    <telerik:RadSlider ID="PagerSlider" runat="server"
        MaximumValue="4" CssClass="slider"
        DecreaseText="Prev" IncreaseText="Next" DragText='<%# "Page " + (RadListView1.CurrentPageIndex + 1).ToString() + " of 5" %>'
        AutoPostBack="True" OnValueChanged="PagerSlider_ValueChanged"
        DbValue="0" Height="22px" Length="200" Width="200px">
    </telerik:RadSlider>
  2. jumpstart
    jumpstart avatar
    479 posts
    Member since:
    Nov 2011

    Posted 23 Mar 2012 Link to this post

    Stephan:

    Items in the RadListView are not selectible without having some type of a control such as a button embedded in the item template that can fire the Select/Deselect command and the associated code behind. Take a look at the Selecting Items documentation page which states:

    "Note, that you need to provide Select/Deselect buttons in both Item and AlternatingItem templates"


    Your item templates only contain labels and no buttons, so they're configured as "read only".

    Take a look at the ListView/First Look online demo and notice the "edit" "delete" buttons.

    Hope this helps!
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top