title: the selectedindex and selectedvalue attributes are mutually exclusive exception?
body: <pre><code>protected void ddlbranchdate_SelectedIndexChanged(object sender, EventArgs e)
  {
      try
      {
          DataTable dtgetvalues = new DataTable();
          //objRetailPL.date = Convert.ToDateTime(hdndate.Value);
          objRetailPL.branchdate = ddlbranchdate.SelectedItem.ToString();
          dtgetvalues = objRetailBAL.getbradisdate(objRetailPL);
          foreach(GridViewRow row in gvMeatDispatch.Rows)
          {
              DataTable dtpr = new DataTable();
              DropDownList ddl1 = (DropDownList)row.FindControl("ddlpartyname");
              objRetailPL.branch = dtgetvalues.Rows[0]["branch"].ToString();
  
              dtpr = objRetailBAL.getbran(objRetailPL);
              ddl1.DataSource = dtpr;
              ddl1.DataTextField = "partyname";
              ddl1.DataValueField = "sno";
              ddl1.DataBind();
              ddl1.Items.Add(new ListItem("--Select--", "0"));
             ddl1.SelectedIndex = ddl1.Items.Count - 1;
          }
      }
   }
  </code></pre>
  
  <p>why i am getting this exception?..</p>
  
  <p>i am using Dynamic Gridview and adding Rows Dynamically with the help of Button Control..</p>
  
  <p>Outside i am declare another dropdown list ..if user selected some value from this Dropdownlist
  then automatically bind the values to Dynamic Gridview ,Dropdown list values..</p>
  
  <p>This is my Setprevious Data in Dynamic control Method..Here i called Dropdownlist selectedindexchanged event ..like..</p>
  
  <pre><code>private void SetPreviousData()
  {
      try
      {
          int rowIndex = 0;
          if (ViewState["CurrentTable"] != null)
          {
              DataTable dt = (DataTable)ViewState["CurrentTable"];
              if (dt.Rows.Count &gt; 0)
              {
                  for (int i = 0; i &lt; dt.Rows.Count; i++)
                  {
                      DropDownList ddlpname = (DropDownList)gvMeatDispatch.Rows[rowIndex].Cells[1].FindControl("ddlpartyname");
                      DropDownList ddlbt = (DropDownList)gvMeatDispatch.Rows[rowIndex].Cells[2].FindControl("ddlbirdtype");
                      TextBox txttotwt = (TextBox)gvMeatDispatch.Rows[rowIndex].Cells[3].FindControl("txttotwt");
                      TextBox txttransbirds1 = (TextBox)gvMeatDispatch.Rows[rowIndex].Cells[4].FindControl("txtrateforkg");
                      TextBox txtmort1 = (TextBox)gvMeatDispatch.Rows[rowIndex].Cells[5].FindControl("txtdcno");
  
                     // Dropdownlist selectedIndex Changed event
  
                      ddlbranchdate_SelectedIndexChanged(null, null);
  
                      ddlpname.SelectedValue = dt.Rows[i]["Col1"].ToString();
                      ddlbt.SelectedValue = dt.Rows[i]["Col2"].ToString();
                      txttotwt.Text = dt.Rows[i]["col3"].ToString();
                      txttransbirds1.Text = dt.Rows[i]["Col4"].ToString();
                      txtmort1.Text = dt.Rows[i]["Col5"].ToString();
  
                      rowIndex++;
                  }
              }
          }
      }
  </code></pre>