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

change the headertext in the edit form

1 Answer 105 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Allen
Top achievements
Rank 1
Allen asked on 29 Jan 2013, 12:07 PM
Hi

I have a radgrid containing some boundcolumns.. I have set headertext to them. But depending upon the value of the boundcolumn in edit mode I want to change the headertext in the edit form. How can I accomplish this.
thanks
Allen

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 29 Jan 2013, 12:12 PM
Hi Allen,

Please try the following code snippet to change the HeaderText in edit form.

C#:
protected void radgrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
 if ((e.Item is GridEditFormItem) && (e.Item.IsInEditMode))
    {
        GridEditFormItem editform = (GridEditFormItem)e.Item;
        TableCell cell1 = (TableCell)editform["UniqueName"].Parent.Controls[0];
        if(your condition)
        {
           cell1.Text = "Your text";
        }
    }
}

Thanks,
Shinu.
Tags
Grid
Asked by
Allen
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or