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

Excel Sort values in ascending order using function TEXTJOIN

 Excel ::  Text ::  1,3,5,2,9,5,11 Result :: 1,2,3,5,5,9,11 Formula ::     TEXTJOIN ( ",",1,SORT(MID(SUBSTITUTE( A1 ,","...