mohammed shamsheer

mohammed shamsheer

  • NA
  • 394
  • 143.8k

ddlPoojaType' has a SelectedValue which is invalid because it does not exist in the list of items.

Nov 22 2012 2:21 AM
i inserted ddlpooja type, date, name, email, mobile, star
and bind it in to grid view. and edit source code is given below.

but it show the error message : " 'ddlPoojaType' has a SelectedValue which is invalid because it does 
not exist in the list of items.
Parameter name: value"

how to solve it



protected void  ibnEdit_Click(object sender, ImageClickEventArgs e)
{
           lblMessage.Text = "";
           mlvPoojBooking.ActiveViewIndex = 0;
           strPage = "0";
           int IntRowIndex = getSelectedRow();
            if (IntRowIndex > -1)
            {
                ddlPoojaType.Text = ((Label)grdPoojaBookings.Rows[IntRowIndex].FindControl("lblgrdPoojaType")).Text.ToString();
                txtDate.Text = ((Label)grdPoojaBookings.Rows[IntRowIndex].FindControl("lblgrdDate")).Text.ToString();
                txtName.Text = ((Label)grdPoojaBookings.Rows[IntRowIndex].FindControl("lblgrdName")).Text.ToString();
                txtEmail.Text = ((Label)grdPoojaBookings.Rows[IntRowIndex].FindControl("lblgrdEmail")).Text.ToString();
                txtMobile.Text = ((Label)grdPoojaBookings.Rows[IntRowIndex].FindControl("lblgrdMobile")).Text.ToString();
                txtStar.Text = ((Label)grdPoojaBookings.Rows[IntRowIndex].FindControl("lblgrdStar")).Text.ToString();
                ibnSubmit.CommandArgument = ((Label)grdPoojaBookings.Rows[IntRowIndex].FindControl("lblgrdId")).Text.ToString();
                intSave = 1;


            }
            else
            {
                Clearall();
                intSave = 0;
            }
}