Change TextBox properties in edit mode

3 posts, 0 answers
  1. Bruce
    Bruce avatar
    33 posts
    Member since:
    Oct 2006

    Posted 25 Mar 2009 Link to this post

    When a user clicks the "edit" link on a grid row and the fields for the row are displayed as textboxes (for changing the data), how can I access the textbox properties? (to change the font, etc.) 
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 25 Mar 2009 Link to this post

    Hi Bruce,

    Try the following code snippet in the ItemDataBound event to access the TextBox 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["columnUniqueName"].Controls[0]; 
                txtbx.Font.Name = "Garamond"
            } 
        } 


    Thanks
    Princy.


  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Bruce
    Bruce avatar
    33 posts
    Member since:
    Oct 2006

    Posted 25 Mar 2009 Link to this post

    Just what I was looking for - Thanks!
Back to Top