finding control in grid view?
<p>in my application i am trying to get the checkbox which is in the gridview i use the foreach control but it is shoing null this is my code./..</p>

<p>source</p>

<p>
              
                
                  
                     '>
                     ' Visible ="false" >
                  
                
                
                  
                     '>
                  
                  
                     ' TextMode="multiLine"  >
                  
                
                
                  
                     '>
                  
                  
                     ' TextMode="multiLine"  >
                  
                <br>
                
                  
                   '>
                  
                  
                      ' />
                  
                <br>
              
               
               
               
               
               
               
               
           </p>

<p>public void getPlaylist()//i write the finding control in a method 
    {
        MyplalistBL clsMyplalstBl=new MyplalistBL ();
        clsMyplalstBl.Userid = Session["userid"].ToString();
        DataSet ds = clsMyplalstBl.getPlaylistBl();
        if (ds.Tables[0].Rows.Count > 0)
        {</p>

<pre><code>        grdplaylist .DataSource =ds.Tables [0];
        grdplaylist.DataBind();

        foreach (GridViewRow gr in grdplaylist.Rows)
        {
            CheckBox ch = (CheckBox)gr.FindControl("chksett");
            string s = ds.Tables[0].Rows[0]["settings"].ToString();

            if (s == "P")
            {
                ch.Checked = true;
            }
            else if (s == "PV")
            {
                ch.Checked = false;
            }


        }


    }
    else
    {
        grdplaylist.DataSource = null;
        grdplaylist.DataBind();

    }
}
</code></pre>
