Change text of 'Edit', 'Insert' and 'Update'

8 posts, 0 answers
  1. Daniel Plomp
    Daniel Plomp avatar
    130 posts
    Member since:
    Feb 2004

    Posted 25 Jun 2008 Link to this post

    Hi telerik,

    I have some trouble finding the properties inside the r.a.d.grid designer for changing the text values for the Edit, Insert and Update buttons when I am in (InPlace) edit-mode.

    I've found the ones under EditFormSettings --> EditColumn, but that didn't change the values when editing inside a row?

    Am I missing something or do I have to do this in code?

    Greetings,
    Daniel
  2. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 25 Jun 2008 Link to this post

    Hello Daniel,

    To change the text values of the Edit/Update/Insert/Cancel button when using InPlace editing, set the corresponding properties (EditText, UpdateText, etc.) directly through the GridEditCommandColumn instance you added to the grid.

    Best regards,
    Stephen
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 25 Jun 2008 Link to this post

    Hi,

    Try setting it in the GRidEditCommandColumn as shown below.

    ASPX:
    <telerik:GridEditCommandColumn  EditText="Change" UpdateText="Save"  CancelText="Exit"  ></telerik:GridEditCommandColumn> 
     


    Thanks
    Princy.
  5. Daniel Plomp
    Daniel Plomp avatar
    130 posts
    Member since:
    Feb 2004

    Posted 25 Jun 2008 Link to this post

    Hmmm... I suppose that works when you have manually added a GridEditCommandColumn?

    I checked the options 'Auto generate edit column at runtime' and 'Auto generate delete column at runtime' from the smart tag menu.

    So I think I'll have to add it myself and uncheck these properties from the smart tag menu?

    Daniel
  6. Daniel Plomp
    Daniel Plomp avatar
    130 posts
    Member since:
    Feb 2004

    Posted 25 Jun 2008 Link to this post

    I think it can be done at runtime with this code:

    1 protected void grid_ItemDataBound(object sender, GridItemEventArgs e)  
    2     {  
    3         if (e.Item is GridCommandItem)  
    4         {  
    5             (e.Item.Controls[0].Controls[0].Controls[0].Controls[0].Controls[0]  
    6              as LinkButton).Text = "Insert";  
    7  
    8             (e.Item.Controls[0].Controls[0].Controls[0].Controls[1].Controls[0]  
    9                 as LinkButton).Text = "Update";  
    10         }  
    11     } 

    ... but then again it is easier to add the columns manually :)

    Daniel
  7. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 25 Jun 2008 Link to this post

    Hi Daniel,

    Try the following code snippet to change the Text properties for the AutoGeneratedEditColumn in the ColumnCreated event.

    CS:
      protected void RadGrid1_ColumnCreated(object sender, GridColumnCreatedEventArgs e) 
        { 
            GridColumn col = (GridColumn)e.Column; 
            if (col.UniqueName == "AutoGeneratedEditColumn") 
            { 
                GridEditCommandColumn editCol = (GridEditCommandColumn)e.Column; 
                editCol.UpdateText = "Save"
                editCol.EditText = "Change"
                editCol.CancelText = "Exit"
            } 
        } 


    Hope this helps..
    Shinu.
  8. Daniel Plomp
    Daniel Plomp avatar
    130 posts
    Member since:
    Feb 2004

    Posted 25 Jun 2008 Link to this post

    Hi Shinu,

    Thanks for thinking with me.
    I'll try your solution.

    Daniel
  9. Sacha Rice
    Sacha Rice avatar
    8 posts
    Member since:
    Aug 2008

    Posted 05 Sep 2008 Link to this post

    Here's the VB version, slightly different but same result, will work for Autogenerated and Manually inserted columns. This is most useful when using a grid to display multiple types of data.


    1         If e.Column.ColumnType.ToString = "GridEditCommandColumn" Then 
    2             Dim Col As Telerik.Web.UI.GridEditCommandColumn = RadGrid1.Columns(e.Column.EditFormColumnIndex)  
    3             Col.EditText = "Your Edit Text" 
    4             Col = Nothing 
    5         End If 
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017