show some values in radgrid template textbox on page load

2 posts, 0 answers
  1. ithihas
    ithihas avatar
    14 posts
    Member since:
    Jun 2012

    Posted 12 Apr 2012 Link to this post

    How can i show some values in template text box on page load (not from db).
    Thanks............................
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 12 Apr 2012 Link to this post

    Hello Pradeep,

    Try the following code to set text in textbox.
    C#:
    protected void grid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
    {
      if (e.Item is GridDataItem)
     {
      GridDataItem item = (GridDataItem)e.Item;
      TextBox txt = (TextBox)item.FindControl("TextBox1");
      txt.Text = "your text";
     }
    }

    Thanks,
    Shinu.
Back to Top