Monday, 25 June 2012

selecet girdview row clickon any where on row

protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {                            
            e.Row.Attributes.Add("onclick",     String.Format("javascript:__doPostBack('GridView1','Select${0}')", e.Row.RowIndex));
        }
    }


 protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
    { 
       string tt=((Label)GridView1.SelectedRow.Cells[1].FindControl("Label1")).Text;
         lblSelectedRow.Text = tt;               
    }

No comments:

Post a Comment

How to highlight selected text in notepad++

  –> To highlight a block of code in Notepad++, please do the following steps step-1  :- Select the required text. step-2  :- Right click...