• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 195
  • Last Modified:

How to do a Client Event on a Gridview on asp.net

Hi all i ma doiugn a project wwhere i need have a click event on a gridview i need to run a query based on the details on col 0 {Staff id} and opass the data to anothe form
0
awolarczuk
Asked:
awolarczuk
  • 2
  • 2
1 Solution
 
MrunalCommented:
Hi
Can you please explain more, from client side you want to pass just parameter and aslo want to navigate on next page also?

Also do you want any link or something on which you want to click and proceed further?

0
 
awolarczukAuthor Commented:
Hi there mroonal: ithanks for getting bacl to me i want to use a gridview list and i want to be able to client on it and take the number from teh first colume of the row i client on and run pass it to a page and then from that other page run a sql query to fill in the page

Does that help
0
 
awolarczukAuthor Commented:
This is what i have but when i client on the Grid view it doenst seem to do anything


    Protected Sub gvItems_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles gvItems.SelectedIndexChanged
        ' Get the currently selected row using the SelectedRow property.
        Dim row As GridViewRow = gvItems.SelectedRow

        ' Display the company name from the selected row.
        ' In this example, the third column (index 2) contains
        ' the company name.

        MsgBox("You selected " & row.Cells(2).Text & ".")
    End Sub
0
 
MrunalCommented:
try this code:

<table id="ItemsContainer" class="itemsCss" border="1" cellpadding="0" cellspacing="0" width="500px">
        <tr>
        <th>        
        ItemID</th>
        <th>
        Item Name</th>
        <th>
        Item Price</th>
        <th>
        Purchase Date</th>
        </tr>
        <tr>
        <td>        
        2</td>
        <td>
        Item Name 2</td>
        <td>
        $10.00</td>
        <td>
        08/08/2011</td>
        </tr>
        <tr>
        <td>        
        3</td>
        <td>
        Item Name 3</td>
        <td>
        $50.00</td>
        <td>
        08/20/2011</td>
        </tr>
        <tr>
        <td>        
        4</td>
        <td>
        Item Name 4</td>
        <td>
        $35.00</td>
        <td>
        12/04/2011</td>
        </tr>
    </table>

==========================

add this jquery code:

$(document).ready(function () {
    GetFirstNumber();
});

function GetFirstNumber() {
    $('table.itemsCss').find('tr').each(function () {
        $(this).bind('click', function (index) {
            alert($(this).find('td:eq(0)').html());
        });
    });
}
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now