mohammed shamsheer

mohammed shamsheer

  • 1.2k
  • 394
  • 140.1k

how to bind gridview value to dropdownlist in popup

Sep 11 2013 10:20 AM
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)