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

How to change style of textboxes in EditForm

1 Answer 9 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jaime
Top achievements
Rank 1
Jaime asked on 14 Oct 2008, 02:35 PM
Hello... I have spent so much time trying to change the style of textboxes of the autogenerated EditForm when an item is to be inserted or updated, with no success.

Any hint will be appreciated
Thanks
Jaime

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 14 Oct 2008, 03:14 PM
Hello Jaime,

You can change the desired style on ItemCreated event as shown in the code-snippet below:
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e) 
    GridEditFormItem item = e.Item as GridEditFormItem; 
    if (item != null && item.IsInEditMode) 
    { 
        TextBox textBox1 = item["CategoryName"].Controls[0] as TextBox; 
        if (textBox1 != null
        { 
            textBox1.BackColor = System.Drawing.Color.Yellow; 
        } 
    } 

Regards,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Jaime
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or