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

[Solved] Size of In-Line Update/Insert Boxes

1 Answer 117 Views
Grid
This is a migrated thread and some comments may be shown as answers.
wedrown
Top achievements
Rank 1
wedrown asked on 06 May 2008, 08:04 PM
When inserting or updating rows in a RadGrid in-place, is there a way to control the size the automatically generated text boxes?

For example, I can control the size of the filter text boxes in the RadGrid1_ItemCreated method, but I don't know how to do the same for the text boxes when the user edits or inserts data in-line.

Thank You,

David Nowak.

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 07 May 2008, 05:25 AM
Hi,

Try the following code snippet to change the TextBox size in edit mode.

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


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