protected void gvCosubcategoryList_RowDeleting(object sender, GridViewDeleteEventArgs e) { DropCategoryname.ClearSelection(); DropSubCategory.ClearSelection(); int intCosubcategoryId = Convert.ToInt32(gvCosubcategoryList.DataKeys[e.RowIndex].Value); CCoSubCategoryMaster ObjCosubcategory = new CCoSubCategoryMaster(intCosubcategoryId); DropCategoryname.SelectedValue = ObjCosubcategory.CategoryId.ToString(); if (ObjCosubcategory.IsExit == true) { TxtCosubcategory.Text = ObjCosubcategory.CosubcategoryId.ToString(); DropCategoryname.SelectedValue = ObjCosubcategory.CategoryId.ToString(); DropSubCategory.SelectedValue = ObjCosubcategory.SubcategoryId.ToString(); TxtDescription.Text = ObjCosubcategory.Cosubcategorydesc.ToString(); DropStatus.SelectedValue = ObjCosubcategory.Status.ToString(); } int intReturnValue = CCoSubCategoryMasterServices.CosubcategoryDelete(Convert.ToInt32(TxtCosubcategory.Text)); if (intReturnValue > 0) { Lblmsg.Text = "Cosubcategory Delete"; BindGv(); TxtCosubcategory.Text = ""; TxtDescription.Text = ""; } }
protected void gvCosubcategoryList_RowEditing(object sender, GridViewEditEventArgs e) { ButCancle.Visible = true; ButInsert.Visible = false; ButUpdate.Visible = true; DropSubCategory.Items.Clear(); DropCategoryname.ClearSelection(); int intCosubcategoryId = Convert.ToInt32(gvCosubcategoryList.DataKeys[e.NewEditIndex].Value); CCoSubCategoryMaster ObjCosubcategory = new CCoSubCategoryMaster(intCosubcategoryId); //CSubCategoryMaster ObjsubCategory = new CSubCategoryMaster((Convert.ToInt32(DropCategoryname.SelectedValue))); DropCategoryname.SelectedValue = ObjCosubcategory.CategoryId.ToString(); BindSubcategoryname((Convert.ToInt32(DropCategoryname.SelectedValue))); if (ObjCosubcategory.IsExit == true) { TxtCosubcategory.Text = ObjCosubcategory.CosubcategoryId.ToString(); DropCategoryname.SelectedValue = ObjCosubcategory.CategoryId.ToString(); DropSubCategory.SelectedValue = ObjCosubcategory.SubcategoryId.ToString(); TxtDescription.Text = ObjCosubcategory.Cosubcategorydesc.ToString(); DropStatus.SelectedValue = ObjCosubcategory.Status.ToString(); } }