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

Change Insert link text to something else

3 Answers 87 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 1
Richard asked on 05 Dec 2012, 04:00 PM
I have a RadGrid with a popup editor to add new records and edit existing ones using the default settings.  This has 2 links, "Insert" and "Cancel"  (or "Update" and "Cancel").

I have been told that non-technical users may find the term "Insert" confusing and I would like to change the word "Insert" to a different word such as "Create".  Can this be done?

Also, can the position of the links be changed so they are aligned to the right of the popup instead of the left?

Thanks, Richard Jonas

3 Answers, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 06 Dec 2012, 03:42 AM
Hello,

Insert.
<MasterTableView CommandItemDisplay="Top" EditMode="InPlace">
               <CommandItemSettings AddNewRecordText="Craete Text Comes here" />

Update/Cancel
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
   
       if (e.Item.IsInEditMode)
       {
           if (e.Item is GridDataInsertItem)
           {
               GridEditableItem editItem = (GridEditableItem)e.Item;
               LinkButton InsertButton = (LinkButton)editItem.FindControl("PerformInsertButton");
               InsertButton.Text = "update text in insert mode";
               LinkButton CancelButton = (LinkButton)editItem.FindControl("CancelButton");
               CancelButton.Text = "Cancel text in insert mode";
           }
           else
           {
               GridEditableItem editItem = (GridEditableItem)e.Item;
               LinkButton updateButton = (LinkButton)editItem.FindControl("UpdateButton");
               updateButton.Text = "update text in edit mode";
               LinkButton CancelUpdateButton = (LinkButton)editItem.FindControl("CancelButton");
               CancelUpdateButton.Text = "update text in edit mode";
           }
       }
 
   }

Note : If you used buttontype='image' then used ImageButton inplaceof LinkButton


Thanks,
Jayesh Goyani
0
Shinu
Top achievements
Rank 2
answered on 06 Dec 2012, 04:45 AM
Hi,

Try the following code to change the position of buttons.
C#:
protected void RadGrid2_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
 if (e.Item is GridEditFormInsertItem && e.Item.OwnerTableView.IsItemInserted)
 {
   GridEditFormInsertItem editItem = (GridEditFormInsertItem)e.Item;
   LinkButton InsertButton = (LinkButton)editItem.FindControl("PerformInsertButton");
   InsertButton.CssClass = "ChangePosition";
 }
}
CSS:
.ChangePosition
{
     margin-left:300px;
}

Thanks,
Shinu.
0
Richard
Top achievements
Rank 1
answered on 06 Dec 2012, 11:07 AM
Thanks - this has worked perfectly.
Tags
Grid
Asked by
Richard
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Shinu
Top achievements
Rank 2
Richard
Top achievements
Rank 1
Share this question
or