in edit mode

3 posts, 1 answers
  1. Webster Velasco
    Webster Velasco avatar
    114 posts
    Member since:
    Jun 2012

    Posted 14 Jun 2010 Link to this post

    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. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 15 Jun 2010 Link to this post

    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.





  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Webster Velasco
    Webster Velasco avatar
    114 posts
    Member since:
    Jun 2012

    Posted 15 Jun 2010 Link to this post


Back to Top