Dear Sir,
I have facing a problem in asp.net.
i have define some variable in rowcommand of gridview but when ever i click any button or click checkbox of gridview or select any droopdown all variable become for 0 number and null for string. i can not use in further function.
please help me sir value should remain same as define during row command. all code is under updatepanel
============================ My code ================================
protected void GvServiceSchedule_RowCommand(object sender, GridViewCommandEventArgs e)
{
ServiceTypeCode = "";
ServiceTypeDescription = "";
ServiceTypeCode = "";
ServiceTypeKM = 0;
ServiceTypeNextServiceKm = 0;
ServiceTypeChargeTo = "";
ServiceTypeFRT = "";
ServiceTypeTu = 0;
ServiceTypePaid = "";
ServiceTypeNextDays = 0;
ServiceTypeSalePrice = 0;
ServiceTypeCostPrice = 0;
if (e.CommandName == "DisplayServiceItemAndLabour")
{
int index = Int32.Parse(e.CommandArgument.ToString());
GridViewRow row = GvServiceSchedule.Rows[index];
ServiceTypePaid = row.Cells[2].Text;
ServiceTypeCode = row.Cells[3].Text;
ServiceTypeKM = int.Parse(row.Cells[4].Text);
ServiceTypeDescription = row.Cells[5].Text;
ServiceTypeSalePrice = Convert.ToDouble(row.Cells[6].Text);
ServiceTypeNextDays = int.Parse(row.Cells[7].Text);
ServiceTypeNextServiceKm = int.Parse(row.Cells[8].Text);
ServiceTypeChargeTo = row.Cells[9].Text;
ServiceTypeFRT = row.Cells[10].Text;
ServiceTypeTu = int.Parse(row.Cells[11].Text);
ServiceTypeCostPrice = Convert.ToDouble(row.Cells[12].Text);
LoadServicePackageList();
}
}
// End Row Command service schedule