protected void cboTaxRate_SelectedIndexChanged(object sender, EventArgs e) { DropDownList cboTaxRate = (DropDownList)sender; int taxRateID = 0; if (int.TryParse(cboTaxRate.SelectedValue, out taxRateID)) { GridDataItem gdi = (GridDataItem)cboTaxRate.Parent.Parent; int preInvoiceID = 0; if (int.TryParse(gdi.GetDataKeyValue("PreInvoiceID").ToString(), out preInvoiceID)) { Facade.IPreInvoice facPreInvoice = new Facade.PreInvoice(); facPreInvoice.UpdateTaxRate(preInvoiceID, taxRateID, ((Entities.CustomPrincipal)Page.User).UserName); gvPreInvoices.MasterTableView.Rebind(); } } }