Click here to Skip to main content
15,893,622 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi i have taken one gridview and written the below code


C#
protected void gricolor_SelectedIndexChanged(object sender, EventArgs e)
{
    Response.Write("Gridview selected index event fired");

}

protected void GridColor_SelectedIndexChangingEvent( object s,GridViewSelectEventArgs e)
{
    Response.Write("Changing event fired");
}



But the event not fired
Posted
Comments
Shahriar Iqbal Chowdhury/Galib 15-Oct-12 17:25pm    
post the markup of your GridView

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

Do you have any button inside your gridview?

Check this link[^]
 
Share this answer
 
v2
Comments
Samsani.v.s.Durga Prasad 15-Oct-12 23:31pm    
I put "ok" button in gridview, i wrote the button click event in code behind. When clicked on the "ok" button GridView.SelectedIndexChanged Event not fired but button click event fired
Samsani.v.s.Durga Prasad 15-Oct-12 23:40pm    
Sorry i did not put the AutogeneratedSelect button property to true,that was the problem here. After put the AutogeneratedSelect to true GridView.SelectedIndexChanged Event was fired
Thanks
Did you remember to wire up the event to your GridView?
HTML
<asp:gridview onselectedindexchanged="gricolor_SelectedIndexChanged" xmlns:asp="#unknown"></asp:gridview>
 
Share this answer
 
by puttin AutoGeneratedselectebutton=true in gridveiw properties
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900