c# - GridView.SelectedIndexChanged doesn't fire -


hello have gridview connected event selectedindexchanged , on hidden panel when try fire event don't anything. code of gridview:

<asp:gridview id="gridview1" runat="server" cssclass="mgrid"                      width="847px" onselectedindexchanged="gridview1_selectedindexchanged2">                     <columns>                         <asp:buttonfield text="borrar" />                     </columns>                 </asp:gridview> 

this code on event:

protected void gridview1_selectedindexchanged2(object sender, eventargs e) {     gridviewrow row = gridview1.selectedrow;     response.write(row.cells[2].text); } 

that's because button isn't selectbutton, 1 approach set autogeneratesselectbutton property on gridview true. rid of other button you're trying make work.

if need other button you'll need make commandfield , set showselectbutton true. configuration can set selecttext , have custom text button.

either way, button isn't going selectedindexchanged.


Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -