Click here to Skip to main content
15,883,797 members
Articles / Web Development / ASP.NET

Extended ASP.NET GridView with cell click events

Rate me:
Please Sign up or sign in to vote.
4.71/5 (7 votes)
21 Jan 2010CPOL2 min read 77K   2K   25  
An extended ASP.NET Gridview control with cell click events.
Partial Public Class _Default
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        
    End Sub

    Protected Sub XGridView_CellClicked(ByVal sender As Object, ByVal e As CustomControls.GridViewCellClickedEventArgs) Handles XGridView.CellClicked
        lblResult.Text = "Index of the cell clicked was:  " & e.ColumnIndex.ToString         'Column Index   
        lblResult0.Text = "Value of cell clicked:  " & e.Cell.Text.ToString                   'Value of Cell
        lblResult1.Text = "Index of the row clicked was:  " & e.Row.RowIndex                  'Row index of cell
    End Sub
End Class

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
South Africa South Africa
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions