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 = ""; } }
public void BindSubcategoryname(int CategoryId) { DataSet dsSubcategoryMasterListbyCategoryId = CSubCategoryMasterServices.SubCategoryMasterListbyCategoryId(Convert.ToInt32(DropCategoryname.SelectedValue)); DropSubCategory.DataSource = dsSubcategoryMasterListbyCategoryId; DropSubCategory.Items.Clear(); DropSubCategory.DataTextField = "SubCategoryName"; DropSubCategory.DataValueField = "SubCategoryId"; DropSubCategory.DataBind(); }