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

[Solved] EditForm - textareas rather than textboxes

2 Answers 182 Views
Grid
This is a migrated thread and some comments may be shown as answers.
blue
Top achievements
Rank 1
blue asked on 24 Feb 2010, 04:24 PM
Hi. I'm using a RadGrid in a relatively default form, with AutoGenerateColumns="false" and EditMode="PopUp". The Edit form works great straight-out of the box, with the small exception of a textbox that I would like to make a textarea (multi-row textbox). Is there anyway to do this without going down the custom editform template route? Thanks, Chris

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 25 Feb 2010, 04:59 AM
Hello,

You can access the textbox control in editform from code behind and set the TextMode to MultiLine.

C#:
 
    protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) 
    { 
        if (e.Item is GridEditFormItem && e.Item.IsInEditMode) 
        { 
            GridEditFormItem editItem = (GridEditFormItem)e.Item; 
            TextBox textBox = (TextBox)editItem["columnUniqueName"].Controls[0]; 
            textBox.TextMode = TextBoxMode.MultiLine; 
        } 
    } 

-Shinu.
0
blue
Top achievements
Rank 1
answered on 25 Feb 2010, 08:58 AM
Fantastic - thanks for your help. I guess that was pretty obvious really, I guess that "I couldn't see the wood for the trees!"
Tags
Grid
Asked by
blue
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
blue
Top achievements
Rank 1
Share this question
or