Monday, 26 August 2013

GridView.SelectedIndexChanged doesn't fire

GridView.SelectedIndexChanged doesn't fire

Hello i have a gridview that is connected to the event
selectedindexchanged and is on a hidden panel but when i try to fire the
event don't do anything. This is the code of the gridview:
<asp:GridView ID="GridView1" runat="server" CssClass="mGrid"
Width="847px"
onselectedindexchanged="GridView1_SelectedIndexChanged2">
<Columns>
<asp:ButtonField Text="Borrar" />
</Columns>
</asp:GridView>
This is the code on the event:
protected void GridView1_SelectedIndexChanged2(object sender,
EventArgs e)
{
GridViewRow row = GridView1.SelectedRow;
Response.Write(row.Cells[2].Text);
/*OdbcConnection conn = connection();
conn.Open();
OdbcCommand delSQL = new OdbcCommand("DELETE from patrimony_reg "
+ "where _description=? and loan=? and id_client=?
and" +
" _type=(SELECT code FROM status_reg WHERE
_label_='ACTIVOS FIJOS')", conn);
delSQL.Parameters.Add("description", OdbcType.VarChar,
row.Cells[1].Text.Length).Value = row.Cells[1].Text;
delSQL.Parameters.Add("loan", OdbcType.BigInt,
loandIDCount.ToString().Length).Value = loandIDCount;
delSQL.Parameters.Add("client", OdbcType.BigInt,
id_client.ToString().Length).Value = id_client;
delSQL.ExecuteScalar();
Double currentTotal = Double.Parse(totalClient.Text);
totalClient.Text = (currentTotal -
Double.Parse(row.Cells[2].Text)).ToString();
GridView1.DeleteRow(GridView1.SelectedIndex);
setactives_client();
conn.Close();*/
}

No comments:

Post a Comment