I have a problem in listview to select a specific row. I want to select a row in click event please help.

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>ListView Showing</title>

    <link href="CSS/yui/tblstyle.css" rel="stylesheet" type="text/css" />

    <script src="js/jquery-1.2.6.min.js" type="text/javascript"></script>
    <script src="js/jquery.tablesorter-2.0.3.js" type="text/javascript"></script>
    <script src="js/jquery.tablesorter.filer.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function() {
            $("#yui").tablesorter({ debug: false, sortList: [[0, 0]], widgets: ['zebra'] })
                .tablesorterFilter({ filterContainer: $("#filterBox"),
                    filterClearContainer: $("#filterClear"),
                    filterColumns: [0, 1, 2, 3, 4, 5, 6],
                    filterCaseSensitive: false
    <form id="form1" runat="server">        
        <asp:ObjectDataSource ID="odsCustomers" runat="server" SelectMethod="Select" TypeName="CustomersDataObject" />
        <asp:ListView ID="ListView1" runat="server" class="LVheiht">
            <table id="yui" class="yui">
                        <td class="tableHeader">
                        <td colspan="6" class="filter">
                            Search: <input name="filter" id="filterBox" value="" maxlength="30" size="30" type="text">
                            <img class="crosImg" id="filterClear" src="images/cross.png" title="Click to clear filter." alt="" />
                        <th width="50">
                            <a href="#">BRCode</a>
                        <th width="50">
                            <a href="#">ACLevel1</a>
                        <th width="50">
                            <a href="#">ACLevel2</a>
                        <th width="50">
                            <a href="#">ACLeve3</a>
                        <th width="50">
                            <a href="#">ACLeve4</a>
                        <th width="250">
                            <a href="#">ACName</a>
                    <tr id="itemPlaceholder" runat="server" />
                <td><%# Eval("BRCode")%></td>
                <td><%# Eval("ACLevel1")%></td>
                <td><%# Eval("ACLevel2")%></td>
                <td><%# Eval("ACLevel3")%></td>
                <td><%# Eval("ACLevel4")%></td>
                <td><%# Eval("ACName")%></td>

I have a problem in listview to select a specific row. I want to select a row in click event please help.

I'm not sure why you include javascript?

I don't see any property in your code to select the listview?

Why not include property? If you didn't create one then try this:

Read this ( which will include how to select the row from the listview ):


and this:


Both links explain how to used it and also it provide an example which you are used it for your own code.

This article has been dead for over six months. Start a new discussion instead.