Click here to Skip to main content
15,883,814 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
C#
protected void grdvwPatientDetails_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "Edit")
            {
                if (Convert.ToInt32(e.CommandArgument) != 0)
                {
                    int patientMedicalId = Convert.ToInt32(e.CommandArgument);
                    var PatientMedicalRecords = objPMBBL.getPatientMedicalRecordsById(patientMedicalId);
                    if (PatientMedicalRecords != null)
                    {
                        BindNewPatientDetails(PatientMedicalRecords.PatientId.Value);

                        txtbpSys.Text = PatientMedicalRecords.BPSystolic;
                        txtbpDias.Text = PatientMedicalRecords.BPDiastolic;
                        txttemp.Text = PatientMedicalRecords.Temperature;
                        txtpuls.Text = PatientMedicalRecords.Pulse;
                        txtrespRate.Text = PatientMedicalRecords.RespiratoryRate;
                        txtweght.Text = PatientMedicalRecords.Weight.ToString();
                        txtheight.Text = PatientMedicalRecords.Height.ToString();

                        BindSymptom(PatientMedicalRecords.Id);
                        UpdatePanel_newMedicleRecord.Update();
                    }
                }
            }
        }
;
every gridview is binding by the below method

C#
private void BindSymptom(int PMRId)
        {
            var PatientSymptomList = objPMBBL.getGetSymptomBY_PMD_idById(PMRId);
            if (PatientSymptomList.Count > 0)
            {
                grdSymtom.DataSource = PatientSymptomList;
                grdSymtom.DataBind();
                if (PatientSymptomList.Count > 0)
                    grdSymtom.HeaderRow.TableSection = TableRowSection.TableHeader;
            }
        }


but when i call all the grid bind method with static value in page load it's working fine but i want to bind all grid in row command


it's urgent..if anyone have solution plz help
Posted
Updated 5-Dec-14 21:51pm
v2
Comments
You are binding inside the RowCommand. You are calling the bind method. So, what is the issue?
itsathere 6-Dec-14 4:59am    
please read the code carefully..grid is binding in row command but not showing
Have you debugged?
itsathere 6-Dec-14 5:59am    
multiple times..
manvendra patel 12-Jan-15 2:19am    
if you are using Update panel then try this
<Triggers>
<asp:AsyncPostBackTrigger ControlID="grdSymtom" EventName="RowCommand" />
</Triggers>

may be it work

1 solution

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

  Print Answers RSS


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