How do you hide the cancel icon

3 posts, 0 answers
  1. Peter Sitero
    Peter Sitero avatar
    15 posts
    Member since:
    Oct 2009

    Posted 12 Nov 2009 Link to this post

    How do you hide the red x cancel image from an InPlace RadGrid form?
  2. Schlurk
    Schlurk avatar
    812 posts
    Member since:
    May 2009

    Posted 12 Nov 2009 Link to this post

    This piece of code should  take care of it:
         
    protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) 
        if (e.Item is GridEditFormItem && e.Item.IsInEditMode) 
        { 
            GridEditFormItem editForm = (GridEditFormItem)e.Item; 
            LinkButton cancelButton = (LinkButton)editForm.FindControl("CancelButton"); 
            cancelButton.Visible = false
        } 

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 13 Nov 2009 Link to this post

    Hello Peter,

    Since you are using Inplace edit mode and also ImageButtons, you can use the following code:
    c#:
     protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e) 
        { 
            if (e.Item is GridEditableItem && e.Item.IsInEditMode) 
            { 
                GridEditableItem editForm = (GridEditableItem)e.Item; 
                ImageButton cancelButton = (ImageButton)editForm.FindControl("CancelButton"); 
                cancelButton.Visible = false
            }      
        } 

    Thanks
    Princy.
Back to Top