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

change the text of the editcommandcolumn in runtime

2 Answers 82 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 1
Ryan asked on 08 Nov 2012, 10:32 AM
Hai
     I want to change the text of the editcommandcolumn in runtime. In aspx i gave an edit text "edit here". However i want to change the text based on my need. How should i change the code to accommodate this. Please share ideas if you have any.
thanks in advance
RT

2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 08 Nov 2012, 10:38 AM
Hi Ryan,

Try the following code to change the text of edit column.
C#:
protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
 if (e.Item is GridDataItem)
 {
    GridDataItem item = (GridDataItem)e.Item;
     if(your condition)
    {
    LinkButton btn = (LinkButton)item["UniqueName"].Controls[0];
    btn.Text = "your text";
    }
 }
}

Thanks,
Shinu.
0
Ryan
Top achievements
Rank 1
answered on 14 Nov 2012, 12:15 PM
Excellent...

Thank you
Tags
Grid
Asked by
Ryan
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Ryan
Top achievements
Rank 1
Share this question
or