2
Answers

how to bind gridview value to dropdownlist in popup

i have column name BenefitDeductType in gridview and dropdown in model popup

i need the selectedtext of dropdown =gridview.BenefitDeductType in rowcommand

ddlBenefitsAndDeductionsType.SelectedValue = Select.Cells[(int)GridColumns.BenefitDeductType].Text;


  int RowIndex = Convert.ToInt32(e.CommandArgument);
        GridViewRow Select=grdBenefitsAndDeducts.Rows[RowIndex];

        txtBenifitsandDeducts.Text=((LinkButton)Select.Cells[(int)GridColumns.TypeName].Controls[0]).Text;
        ddlBenefitsAndDeductionsType.Text = Select.Cells[(int)GridColumns.TypeName].Text;
        string Isbasic = grdBenefitsAndDeducts.DataKeys[RowIndex].Values["IsBasic"].ToString();
        chkIsBasic0.Checked = (Isbasic == "True") ? true : false;
        

        Button1_ModalPopupExtender.Show();
Answers (2)