Quote:Curently 2 click are happening for on Update button to fire.i want only single click for that am also checking on !postback but still it's not working.which i have read in other Stackoverflow answer about binding the grid on updating the row which i am doing but still it's not working. i am binding the grid in pageindex and rowediting event need help INFO: my ASPX page has around 3 update panel
protected void BindGridSubMeter() { ConnectionMRI conMRI = new ConnectionMRI(); DataSet ds = conMRI.NabersSubMetergetData(ddlBldgId.SelectedItem.Value); TextExclusions.Text = ds.Tables(1).Rows(0).Item(0).ToString(); var _with1 = GridSubMeter; _with1.DataSource = ds.Tables(0); _with1.DataBind(); } protected void GridSubMeter_RowEditing(object sender, System.Web.UI.WebControls.GridViewEditEventArgs e) { GridSubMeter.EditIndex = e.NewEditIndex; this.BindGridSubMeter(); } protected void GridSubmeter_PageIndexChanging(object sender, System.Web.UI.WebControls.GridViewPageEventArgs e) { GridSubMeter.PageIndex = e.NewPageIndex; this.BindGridSubMeter(); } protected void GridSubMeter_RowUpdating(object sender, System.Web.UI.WebControls.GridViewUpdateEventArgs e) { TextBox txtMeterIdn = (TextBox)GridSubMeter.Rows(e.RowIndex).FindControl("txtMeterIdn"); TextBox txCTFact = (TextBox)GridSubMeter.Rows(e.RowIndex).FindControl("txCTFact"); TextBox txReadStartDate = (TextBox)GridSubMeter.Rows(e.RowIndex).FindControl("txReadStartDate"); TextBox txReadEndDate = (TextBox)GridSubMeter.Rows(e.RowIndex).FindControl("txReadEndDate"); TextBox txStartKwh = (TextBox)GridSubMeter.Rows(e.RowIndex).FindControl("txStartKwh"); TextBox txEndKwh = (TextBox)GridSubMeter.Rows(e.RowIndex).FindControl("txEndKwh"); TextBox txBillPer = (TextBox)GridSubMeter.Rows(e.RowIndex).FindControl("txBillPer"); string MeterIdn = txtMeterIdn.Text.Trim.ToString(); decimal CTFact = Convert.ToDecimal(txCTFact.Text); System.DateTime ReadStartDate = System.DateTime.Parse(txReadStartDate.Text); System.DateTime ReadEndDate = System.DateTime.Parse(txReadEndDate.Text); decimal StartKwh = Convert.ToDecimal(txStartKwh.Text); decimal EndKwh = Convert.ToDecimal(txEndKwh.Text); decimal billper = Convert.ToDecimal(txBillPer.Text); string leasid = GridSubMeter.Rows(e.RowIndex).Cells(0).Text.Trim.ToString(); string suitid = GridSubMeter.Rows(e.RowIndex).Cells(1).Text.Trim.ToString(); string occupant = GridSubMeter.Rows(e.RowIndex).Cells(2).Text.Trim.ToString(); GridSubMeter.EditIndex = -1; ConnectionMRI conMRI = new ConnectionMRI(); conMRI.NaberSubmeter(ddlBldgId.SelectedItem.Value, leasid, suitid, occupant, MeterIdn, CTFact, ReadStartDate, ReadEndDate, StartKwh, EndKwh, billper); BindGridSubMeter(); }
<asp:GridView ID="GridSubMeter" runat="server" AutoGenerateColumns="false" DataKeyNames="leasid" AllowPaging="True" OnPageIndexChanging="GridSubmeter_PageIndexChanging" OnRowEditing="GridSubMeter_RowEditing" OnRowUpdating="GridSubMeter_RowUpdating">
Curently 2 click are happening for on Update button to fire.i want only single click for that am also checking on !postback but still it's not working.which i have read in other Stackoverflow answer about binding the grid on updating the row which i am doing but still it's not working. i am binding the grid in pageindex and rowediting event need
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)