Prasad Bolla's SharePoint Blog

Click Here to go through the Interesting posts within my Blog.

Click Here to go through the new posts in my blog.

Tuesday, February 28, 2012

How to find Controls in GridView with Find Control Object while using Template Field

 if (e.Row.RowType == DataControlRowType.DataRow)
                {
                    Label b2 = (Label)e.Row.FindControl("lblBody");
                    if (b2.Text.Length > 50)
                    {
                        b2.Text = b2.Text.Substring(0, 30);
                        b2.Text = b2.Text + "......";
                    }

                }

No comments:

Post a Comment