Click here to Skip to main content
12,450,771 members (48,045 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: ASP.NET Gridview
I want to know.. When will GridView1_SelectedIndexChanged Event raise...
 
and also how " GridView1.SelectedDataKey " will capture the value... please help me
 
Thanks, Bajid
Posted 27-Nov-13 22:53pm
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

See this : GridView Events[^]

and to get SelectedDataKey use this : Your_GridView.SelectedDataKey.Value.ToString()
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

Occurs when a row's Select button is clicked, but after the GridView control handles the select operation.

Refer MSDN:-

http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.selectedindexchanged%28v=vs.110%29.aspx[^]
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

This will raise. When Button having select command will be clicked so.
This button you can add by edit->commandfiled-> select
or by assiging Commandname="select" to any button
  Permalink  
v2

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160826.1 | Last Updated 28 Nov 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100