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

in edit mode

2 Answers 71 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Webster Velasco
Top achievements
Rank 2
Webster Velasco asked on 14 Jun 2010, 04:02 PM
hi

how can i set the witdh of my textbox in edit mode?

i want to get the full witdh of my column as the width of my boundcoloumn auto editor textbox?

2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 15 Jun 2010, 05:48 AM
Hello Webster,

I guess you are using InPlace EditMode and you want to set the TextBox width same as the column width. If so, you can try the following code snippet:

ASPX:
  
 <telerik:GridBoundColumn DataField="EmployeeID" HeaderText="EmployeeID" UniqueName="EmployeeID"
   <HeaderStyle Width="300px" /> 
 </telerik:GridBoundColumn> 

C#:
 
 protected void radGrid_ItemDataBound(object sender, GridItemEventArgs e) 
 { 
    if (e.Item is GridEditableItem && e.Item.IsInEditMode) 
    { 
        GridEditableItem edititem = (GridEditableItem)e.Item; 
        TextBox txt = (TextBox)edititem["EmployeeID"].Controls[0]; 
        txt.Width = Unit.Percentage(100); 
    } 
 } 

Regards,
Shinu.





0
Webster Velasco
Top achievements
Rank 2
answered on 15 Jun 2010, 10:00 AM

Tags
Grid
Asked by
Webster Velasco
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 2
Webster Velasco
Top achievements
Rank 2
Share this question
or