title: Gridview findcontrol after dropdownlist event
body: <p>I want to findcontrol on griview after DDL OnSelectedIndexChanged event. where the target control is on the rowindex where the DDL is located..</p>
  
  <p>here my codes;</p>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e)
  {
      ArrayList Dummysource = new ArrayList() { "AA", "BB", "CC", "DD" };
  
      if(!IsPostBack )
      {
          GridView1.DataSource = Dummysource;
          GridView1.DataBind();  
      }
  
  }
  
  protected void ddlsample_OnSelectedIndexChanged(object sender, EventArgs e)
  {
      string valueComponent = (sender as DropDownList).SelectedItem.Value;
  
  
      Label1.Text = valueComponent;
  
  }
  
  
  int ddlvalue;
  protected void GridView1_OnRowDataBound(object sender, GridViewRowEventArgs e)
  {
      //Checking whether the Row is Data Row
      if (e.Row.RowType == DataControlRowType.DataRow)
      {
          //Finding the Dropdown control.
          DropDownList ddlsample = (DropDownList)e.Row.FindControl("ddlsample");
          Label ilbldata = (Label)e.Row.FindControl("lbldata");
  
          if (ddlsample != null)
          {
              switch(ilbldata.Text) 
              {
  
                  case "AA":
                      ddlvalue = 2;
                      break;
                  case "BB":
                      ddlvalue = 3;
                      break;
                  case "CC":
                      ddlvalue = 4;
                      break;
                  case "DD":
                      ddlvalue = 5;
                      break;  
  
              }
              for (int i = 1; i &lt;= ddlvalue; i++ )
              {
                  ddlsample.Items.Add(i.ToString() );   
              }
          }
      }
  
  }
  
  protected void GridView1_SelectedIndexChanged(Object sender, EventArgs e)
  
  {
      GridView gv = sender as GridView;
      gv = GridView1; 
      Label  foo = gv.SelectedRow.FindControl("lbldata") as Label ;
      Label2.Text = foo.Text;  
  }
  </code></pre>
  
  <p>the code get the value of the DropDownList selected Item. I'm Wondering on how to get the component value in the gridview. after selectedindexchange event of DDL</p>
  
  <p>I made some visual photo for more clear
  <a href="http://i1288.photobucket.com/albums/b493/Kasparov1/GridviewDDL_zps3721fb97.png" rel="nofollow">http://i1288.photobucket.com/albums/b493/Kasparov1/GridviewDDL_zps3721fb97.png</a></p>
  
  <p>thanks in advance;</p>