Posts

Showing posts with the label Cell Clicked

Get the Clicked Cell Value and Column Name of GridView in ASP.NET

Image
Normally we find the requirement to get the selected Cell Clicked Value .In rare cases we need to find the Column Name and Index of the Cell clicked in the GridView. This is some how tricky work to get the Column name and index also.We can do this in many ways . We must be very much thankful to the jQuery contributors for such beautiful lightweight,fast and concise Library. Really this is very good  we can't iterate the table loop to the clicked cell value. With a Single we can get the clicked Value.Look at this line of Code $('#gv>tbody>tr>td').text(); For this requirement I have taken a grid which i have given a static datasource. protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { AddData(); } } public void AddData() { try { DataTable dt = new DataTable(); dt.Columns.Add("ID", typeof(Int32)); dt.Col...