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

Change text button in radgrid?

3 Answers 301 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Pham
Top achievements
Rank 1
Pham asked on 03 Aug 2012, 04:54 AM
Hi everybody, I have a problem. I have a radgrid, I create a link button in this radgrid. When I click link button,"Update" link button and "Cancel" link button appears. How to change "Update" text and "Cancel" text? 
Have you any ideas? Thanks!
<telerik:RadGrid runat="server" ID="rgdThongTin" Height="350px" Width="100%" AutoGenerateColumns="false"
                          GridLines="None"
                          onneeddatasource="rgdThongTin_NeedDataSource"
                          ondeletecommand="rgdThongTin_DeleteCommand"
                          onupdatecommand="rgdThongTin_UpdateCommand"
                          oninsertcommand="rgdThongTin_InsertCommand">
                          <MasterTableView  DataKeyNames="STT" AllowMultiColumnSorting="True" Width="100%">
                              <Columns>
                                  <telerik:GridBoundColumn DataField="STT" UniqueName="STT" HeaderText="STT" Visible="false">
                                      <HeaderStyle Width="0px" HorizontalAlign="Left" VerticalAlign="Middle" Font-Bold="True" />
                                      <ItemStyle Width="0px" HorizontalAlign="Left" VerticalAlign="Middle" />
                                  </telerik:GridBoundColumn>
                                   
                                  <telerik:GridEditCommandColumn ButtonType="LinkButton" UniqueName="EditCommandColumn"
                                      EditText="Cập nhật">
                                      <HeaderStyle Width="100px" HorizontalAlign="Left" VerticalAlign="Middle" Font-Bold="True" />
                                      <ItemStyle Width="100px" HorizontalAlign="Left" VerticalAlign="Middle" />
                                  </telerik:GridEditCommandColumn>
 
                              </Columns>
                              <EditFormSettings CaptionFormatString="Edit details for employee with" CaptionDataField="MA_SO">
                                 
                              </EditFormSettings>
                          </MasterTableView>
                          <ClientSettings AllowColumnsReorder="true" EnableRowHoverStyle="true">
                              <Selecting AllowRowSelect="true" />
                              <Scrolling AllowScroll="true" UseStaticHeaders="true" />
                              <ClientEvents OnRowDblClick="RowDblClick" />                         
                          </ClientSettings>
                      </telerik:RadGrid>

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 03 Aug 2012, 05:08 AM
Hi,

Please try the following code to set custom text for update and cancel.

ASPX:
<EditFormSettings CaptionFormatString="Edit details for employee with" CaptionDataField="MA_SO">
     <EditColumn UpdateText="your text" CancelText="your text"></EditColumn>                            
</EditFormSettings>

Thanks,
Shinu.
0
Pham
Top achievements
Rank 1
answered on 03 Aug 2012, 07:15 AM
I did, but it is not exactly. Have you any ideas? thanks!
<telerik:GridEditCommandColumn ButtonType="LinkButton" UniqueName="EditCommandColumn"
                                       EditText="Cập nhật">
                                       <HeaderStyle Width="100px" HorizontalAlign="Left" VerticalAlign="Middle" Font-Bold="True" />
                                       <ItemStyle Width="100px" HorizontalAlign="Left" VerticalAlign="Middle" />
                                   </telerik:GridEditCommandColumn>
                                                                       
                               </Columns>
                               <EditFormSettings CaptionFormatString="Edit details for employee with" CaptionDataField="MA_SO">
                                   <EditColumn UpdateText="Sửa" CancelText="Hủy"></EditColumn>
                               </EditFormSettings>
0
Jayesh Goyani
Top achievements
Rank 2
answered on 03 Aug 2012, 07:52 AM
Hello,

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");
                LinkButton CancelButton = (LinkButton)editItem.FindControl("CancelButton");
                // You can change text here or also assign culture
            }
            else
            {
                GridEditableItem editItem = (GridEditableItem)e.Item;
                LinkButton updateButton = (LinkButton)editItem.FindControl("UpdateButton");
                LinkButton CancelUpdateButton = (LinkButton)editItem.FindControl("CancelButton");
                // You can change text here or also assign culture
            }
        }
    }


Thanks,
Jayesh Goyani
Tags
Grid
Asked by
Pham
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Pham
Top achievements
Rank 1
Jayesh Goyani
Top achievements
Rank 2
Share this question
or