This is a migrated thread and some comments may be shown as answers.

show some values in radgrid template textbox on page load

1 Answer 85 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
ithihas
Top achievements
Rank 1
ithihas asked on 12 Apr 2012, 11:50 AM
How can i show some values in template text box on page load (not from db).
Thanks............................

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 13 Apr 2012, 04:56 AM
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.
Tags
General Discussions
Asked by
ithihas
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or