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

How to Edit layout of built in Editing

1 Answer 53 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jon
Top achievements
Rank 1
Jon asked on 29 Sep 2008, 06:12 PM
Hi..
When using the built in editing.. how do I modify the layout of the text boxes.
I want to make a text box multi line and wider.
thanks

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 30 Sep 2008, 04:16 AM
Hi Jon,

You can try out the following code snippet to access textBox in edit mode and set its properties.

CS:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) 
    { 
        if ((e.Item is GridEditableItem) && (e.Item.IsInEditMode)) 
        { 
            GridEditableItem edititem = (GridEditableItem)e.Item; 
            TextBox txtbx = (TextBox)edititem["FirstName"].Controls[0]; 
            txtbx.Width = Unit.Pixel(100); 
            txtbx.TextMode = TextBoxMode.MultiLine; 
        } 
    } 


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